Solved programming problem

Take an integer of length 0 to 9 and then display the digit in English.

Source code

#include<stdio.h>

int main()

{

    int n;

    printf("Please Enter Any Number Between 0 to 9: ");

    scanf("%d",&n);

    if(n==0)

    {

        printf("
This is Zero.
");

    }

    else if(n==1)

    {

        printf("
This is One.
");

    }

    else if(n==2)

    {

        printf("
This is Two.
");

    }

    else if(n==3)

    {

        printf("
This is Three.
");

    }

    else if(n==4)

    {

        printf("
This is Four.
");

    }

    else if(n==5)

    {

        printf("
This is Five.
");

    }

    else if(n==6)

    {

        printf("
This is Six.
");

    }

    else if(n==7)

    {

        printf("
This is Seven.
");

    }

    else if(n==8)

    {

        printf("
This is Eight.
");

    }

    else if(n==9)

    {

        printf("
This is Nine.
");

    }

    return 0;

}

Output

Please Enter Any Number Between 0 to 9: 7

This is Seven.

 

Join the discussion

Add your comment