Computer Science, asked by Jaisgrewal2752, 10 months ago

Write a program to find the reverse of a number (i.e. reverse of 123 is 321)

Answers

Answered by Bigdahero90
0

Answer:

rev_num = rev_num *10 + num%10 = 265 + 4 = 2654

Answered by shilpa85475
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