How to write the reverse of a number in words?
CODE
How
to write the reverse of a number in words?
int main()
{
int n,r;
printf("\n Enter the number:");
scanf("%d",&n);
while(n!=0)
{
r=n%10;
if(r==1)
printf(" One");
else if(r==2)
printf(" Two");
else if(r==3)
printf(" Three");
else if(r==4)
printf(" Four");
else if(r==5)
printf(" Five");
else if(r==6)
printf(" Six");
else if(r==7)
printf(" Seven");
else if(r==8)
printf(" Eight");
else if(r==9)
printf(" Nine");
else
printf(" Zero");
n=n/10;
}
}
Output:
Enter the number: 567
Seven Six Five
How to write the reverse of a number in words?
Reviewed by Unknown
on
December 16, 2018
Rating:
No comments:
If you have any doubt or query ,comment below: