/*
program to reverse a number.....
*/
#include<stdio.h>
#include<conio.h>
void main ()
{
long int num,mod,rev=0;
printf("Enter a number:");
scanf("%ld", &num);
while (num>0)
{
mod=num%10;
rev=(rev*10)+mod;
num=num/10;
}
printf("Reverse of the given number: %ld", rev);
getch();
}
program to reverse a number.....
*/
#include<stdio.h>
#include<conio.h>
void main ()
{
long int num,mod,rev=0;
printf("Enter a number:");
scanf("%ld", &num);
while (num>0)
{
mod=num%10;
rev=(rev*10)+mod;
num=num/10;
}
printf("Reverse of the given number: %ld", rev);
getch();
}
0 comments:
Post a Comment