Page

C Program To find reverse of a number

#include<stdio.h>
#include<conio.h>
void reverse();
void main()
{
extern int n,d,x=1;
extern int i;
clrscr();
printf("Enter the number of digits:");
scanf("%d",&d);
printf("Enter the number which is to be reversed:");
scanf("%d",&n);
printf("\nThe reversed number is :");
while(x<=d)
void reverse();
getch();
}
void reverse()
{
i=n%10;
printf("%d",i):
n=n/10;
x++;
}

No comments:

Post a Comment