0
Write a c program to reverse a given number. Can anyone help out please
4 Antworten
+ 2
#include<stdio.h>
int main() {
int n,reverse=0,rem;
printf("enter number");
scanf("%d",&n);
while( n!=0)
{
rem=n%10;
reverse=reverse*10+rem;
n/=10;
}
printf("reverse number is %d",reverse);
return 0;
}
+ 4
Show your attempts Adi!
+ 3
I googled "reverse a number in c" and first result was:
https://www.programiz.com/c-programming/examples/reverse-number
0
Thank you 😊 Ranita Dey and Arturop