REVERSE A NUMBER USING RECURSION IN C PROGRAM
Solution :
#include<stdio.h>
int main(){
int num,rev;
printf("\nEnter a number :");
scanf("%d",&num);
rev=reverse(num);
printf("\nAfter reverse the no is :%d",rev);
return 0;
}
int sum=0,r;
reverse(int num){
if(num){
r=num%10;
sum=sum*10+r;
reverse(num/10);
}
else
return sum;
return sum;
}
More C Program :
- REVERSE A NUMBER USING RECURSION IN C PROGRAM
- write a c program to reverse a number using recursion
- c program to reverse a string
- reverse a number using recursion in java program
- c program to reverse a number using for loop
- reverse a number using recursion in java
- program to reverse a number in c
- palindrome of a number in c
- c program to reverse a number with explanation