Program for reverse the given number in c language.

#include<stdio.h>

#include<conio.h>

void main()

{

 int n,rev=0,rem;

 clrscr();

 printf("Enter number =");

 scanf("%d",&n);

 while(n>0)

 {

  rem=n%10;

  rev=rev*10+rem;

  n=n/10;

 }

printf("the reverse number is=%d",rev);

getch();

}


■》 output->


Enter number =567

the reverse number is=765


Comments

Popular posts from this blog

Introduction of java Programming language.

Stack data structure.