fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int num=4562,rev=0;
  6.  
  7. while(num!=0){
  8. int digit=num%10;
  9. rev*=10+digit;
  10. num=num/10;
  11. }
  12. printf("%d",rev);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
Standard output is empty