int num=3251;
int rev = 0;
while(num > 0) {
rev rev+num%10;
num/=10;
printf ("Output : "+rev);
Answers
Answered by
1
Program is given below.
Explanation:
The complete program is given below.
//This program is used to find the reverse of a number.
#include <stdio.h>
int main()
{
//Declaring the variables
int num=3251;
//We can take any number in place of 3251
int rev=0;
//Main code
//This code finds the reverse of the number
while(num>0)
{
rev=rev*10+num%10;
num/=10;
}
//This statement prints the reverse of the number
printf("Reverse of the given number is \n");
printf("Output: %d",rev);
return 0;
}
Refer the attached image for the output.
Attachments:
Answered by
0
Answer:
the outside is rev is 11 so because number is greater so is 11
Similar questions