This is the code:
#include <iostream>
using namespace std;
int main() {
int x;
cout << "Enter a positive integer: ";
cin >> x;
if (x <= 0) {
cout << "Illegal" << endl;
exit(1);
}
if (x <= 100) {
cout << x;
}
else {
cout << x/100 << x%10 << endl;
}
return 0;
}
**when the user inputs 456 the output is 46 or say when 4560 output is 450. Can someone please explain me how it happens?