Google Search

Sunday, October 30, 2011

WRITE A C PROGRAM TO REVERSE OF NUMBER


WRITE A PROGRAM TO REVERSE OF NUMBER

#include<stdio.h>
#include<conio.h>
void main()
{
int n,b,s=0;
clrscr();
printf(“Enter the number \n”);
scanf(“%d”,&n);
while(n!=0)
{
b=n%10;
s=(s*10)+b;
n=n/10;
}
printf(“The reverse number is %d”,s);
getch();
}

1 comments:

Post a Comment