Write a program to find the reverse of a number (i.e. reverse of 123 is 321)
Answers
Answered by
0
Answer:
rev_num = rev_num *10 + num%10 = 265 + 4 = 2654
Answered by
0
C PROGRAM TO FIND THE REVERSE OF A NUMBER:
#include <studio.h>
int main ()
{
int number, reminder, reverse=0;
printf (“\n Please enter a number to reverse\n”);
scanf (“%d”, &number);
while (number!=0)
{
reminder = number ×10;
reverse=reverse×10+Reminder;
number=number/10;
}
Printf(“\n Reverse of the entered number is=%d\n”, reverse);
return 0;
}
OUTPUT:
Please enter a number to reverse
123
Reverse of the entered number is = 321
Similar questions
English,
6 months ago
Hindi,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago
Math,
1 year ago