I'm attempting to write a programme in C++ to reverse a number. It works well with numbers like 1234, but when I try to enter a number like 5430, it displays 345, and the same with numbers that begin with zero, such as 0234, which displays 432.
Could someone please explain how to deal with zeros at the beginning and end of a sentence?
I simply need to save the number without converting it to a string.
#include<iostream>
using namespace std;
int main(){
...READ MORE
Jun 30, 2022
in C++
by
Nicholas
• 7,760 points
•
610 views