Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int reverse( num)
- {
- int r;
- int r_num=0;
- while(num!=0)
- {
- r=num%10;
- r_num=r_num*10+r;
- num=num/10;
- }
- return r_num;
- }
- int main()
- {
- int num,r,temp;
- printf("Enter a number:");
- scanf("%d",&num);
- printf("Orginal number:%d",num);
- printf("\nReverse number:%d",reverse(num));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement