#include<stdio.h>
#include<conio.h>
void main()
{
int digit;
printf("Enter the digit (0-9): ");
scanf("%d",&digit);
if(digit==0)
printf("\nZero");
else if(digit==1)
printf("\nOne");
else if(digit==2)
printf("\nTwo");
else if(digit==3)
printf("\nThree");
else if(digit==4)
printf("\nFour");
else if(digit==5)
printf("\nFive");
else if(digit==6)
printf("\nSix");
else if(digit==7)
printf("\nSeven");
else if(digit==8)
printf("\nEight");
else if(digit==9)
printf("\nNine");
else
printf("\nPlease enter a digit between 0 and 9");
getch();
}
Output:
#include<conio.h>
void main()
{
int digit;
printf("Enter the digit (0-9): ");
scanf("%d",&digit);
if(digit==0)
printf("\nZero");
else if(digit==1)
printf("\nOne");
else if(digit==2)
printf("\nTwo");
else if(digit==3)
printf("\nThree");
else if(digit==4)
printf("\nFour");
else if(digit==5)
printf("\nFive");
else if(digit==6)
printf("\nSix");
else if(digit==7)
printf("\nSeven");
else if(digit==8)
printf("\nEight");
else if(digit==9)
printf("\nNine");
else
printf("\nPlease enter a digit between 0 and 9");
getch();
}
Output:
Please have a look at the below lesson posted on my YouTube channel:
No comments:
Post a Comment