Program to reverse a
given number
Program
#include<stdio.h>
void main()
{
int num, right_digit;
printf("\nEnter
The Number : ");
scanf("%d",
&num);
printf("\nThe
Reverse of %d is : ", num);
while(num != 0)
{
right_digit = num %
10;
printf("%d",
right_digit);
num = num / 10;
}
}
No comments:
Post a Comment