#include <iostream>
#include<cmath>
using namespace std;
int main(){
int input;
int mod = 1;
int x;
cout << "Please Enter a four digit Integer: ";
cin >> input;
for(int i = 3; i >= 0; i--){
mod = pow(10,i);
x = input / mod;
input = input % mod;
cout << x << " ";
}
return 0;
}
this is a programming exercise. we are asked to get a 4 digit input from keyboard and display the input with 2 whitespaces in between the number. the problem is with the pow(10,i) function. when i checked what the function gives to the "mod" var is when i is equal to 2, it results to 99 but not 100 because 10 raised to 2 is 100. can you help me debug the code? Thank you