damihenrique

Inverter um Inteiro

Aug 23rd, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. int inverte(int num){
  2.  
  3.         int i = 0;
  4.  
  5.         while(num > 0) {
  6.           i *= 10;
  7.           i += (num % 10);
  8.           num /= 10;
  9.         }
  10.          
  11.         return i;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment