Reverse of a number using while Loop

/* Write a program to find the Reverse of a number using while Loop */

#include<stdio.h>
#include<conio.h>
void main()
{
long rev=0,num,rem,n;
clrscr();
printf("\n Enter the number to Reverse");
scanf("%ld",&n);
num = n ;
while(num != 0)
{
rem = num % 10 ;
num = num / 10 ;
rev = rev * 10 + rem ;
}
printf("\n The Entered Number is = %ld",n);
printf("\n The Reverse Number is = %ld",rev);
getch();

}

Who's online

We have 17 guests and no members online

About Us

Harsimran Singh

Hello

This website is a special gift for Programming Lovers , which want to learn basic Programming Languages and want to develop there skills Read More....

Our work

Find Us

This email address is being protected from spambots. You need JavaScript enabled to view it.

Harsimran Singh(Facebook)

Harsimran Singh(about.me)

Harsimran Singh(G+)