C Program To Reverse A Number

How to write a C Program To Reverse A Number in C Programming Language ?


Solution For C Program :

/*C Program To Reverse A Number.*/


#include<stdio.h>
#include<conio.h>
digit(int);
void main()
{
int num,f;
clrscr();
printf("Enter the any digit number==>");
scanf("%d",&num);
f=digit(num);
printf("\nSum of %d is==> %d",num,f);
getch();
}
digit(int k)
{
int sum=0;
if(k>0)
{
sum=k%10+digit(k/10);//recursion function call
}
return (sum);
}


You may also learn these C Program/Code :

C Program To Swap Two Numbers Without Using Third Variable




Learn More :