Advertisement
BojidarDosev

Reverse a number

Mar 16th, 2024
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.15 KB | None | 0 0
  1.   while (num>0)
  2.     {
  3.         num2 = num % 10;
  4.         num = num / 10;
  5.         sum += num2;
  6.         nums.push_back(num2);
  7.         cout << num2;
  8.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement