GeeksforGeeks » Interview Questions
reverse a number
(3 posts)-
how to reverse a number in c without the use of any function
-
#include <stdio.h> int main() { int num , res= 0; scanf("%d",&num); do { res = res * 10 + num % 10; }while (num/=10); printf("%d\n", res); } -
perfect solution
Reply
You must log in to post.