C Program to Convert Digit to Word

    

 #include<stdio.h> void main()

{ int n;

printf("Enter a digit (0-9): "); scanf("%d",&n);

if(n==0)

printf("Zero");

    else if(n==1)

        printf("One");

        else if(n==2)

            printf("Two");

            else if(n==3)

                printf("Three");

                else if(n==4)

                       printf("Four");

                        else if(n==5)

                            printf("Five");

                               else if(n==6)

                                    printf("Six");

                                        else if(n==7)

                                        printf("Seven");

                                            else if(n==8)

                                                printf("Eight");

                                                    else if(n==9)

                                                        printf("Nine");

                                                            else

                                                                printf("Invalid Digit");

}

Comments

Popular posts from this blog

Single Program Using All Automatic String Functions

C program for subtraction of two matrices (2D Arrays)

C program for Multiplication of Two matrices