fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n;
  5. printf("Enter the number: ");
  6. scanf("%d",&n);
  7.  
  8. int r=0;
  9. while(n>0){
  10. r=r+n%10;
  11. r=r*10;
  12. n=n/10;
  13. }
  14. printf("The reverse is %d",r);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5284KB
stdin
2345
stdout
Enter the number: The reverse is 54320