C program to print input digits in reverse order
#include<stdio.h>
#include<conio.h>
main()
{
int num,n=0,rev=0,d;
printf("Enter any
number\n");
scanf("%d",&num);
n=num;
while(num>0)
{
d=num%10;
rev=rev*10+d;
num=num/10;
}
printf("%d",rev);
getch();
}
No comments:
Post a Comment