So, i have a program in which i should use a natural and positive number and i shall display it's digits in a while program. I input the number but instead of digits i see blank space.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
usingnamespace std;
int main()
{
int nr, c;
cout << "nr= ";
cin >> nr;
while (nr != 0)
{
c = nr % 10;
cout << "c= " <<endl;
nr = nr / 10;
}
return 0;
}