Skip to main content

program to reverse a number entered



LIST OF PROGRAMS



#include<stdio.h>
#include<conio.h>
void main()
{
long int n,x=0,tmp=0;
 clrscr();
printf("Enter a number=\n");
scanf("%ld",&n);
do
{ x=n%10;
 tmp=(tmp*10)+x;
 n=n/10;
 }while(n>0);
printf("New number=  %ld",tmp);
getch();
}

LIST OF PROGRAMS


Comments

Anonymous said…
what is this tmp?
anuj batham said…
tmp is the variable name
you can use any variable name but it must follow the variable declaration rules

Popular posts from this blog

unix commands