//Reverse of the Number
#include<stdio.h>
#include<conio.h>
int main ()
{
int num,mod,rev=0;
printf("Enter a number:");
scanf("%d", &num);
while (num>0)
{
mod=num%10;
rev=(rev*10)+mod;
num=num/10;
}
printf("Reverse of the given number: %d", rev);
getchar();
return 0;
}
// alternative solution based on reversing the alphanumeric representation of
// the number:
void rev(int me) {
char alpha[32];
sprintf(alpha, "%d", me);
for (const char* cp = alpha + strlen(alpha) - 1; cp >= alpha; --cp) {
putchar(cp); }
}
Copyright © 2026 eLLeNow.com All Rights Reserved.