blank space instead of number

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>

using namespace std;

int main()
{
    int nr, c;
    cout << "nr= ";
    cin >> nr;
    while (nr != 0)
    {
        c = nr % 10;
        cout << "c= " <<endl;
        nr = nr / 10;
    }

    return 0;
}
@ralfitul

You're not printing the c variable, in this, or any other, line.
cout << "c= " <<endl;

Try it this way..

cout << "c= " << c <<endl;
Works now, completely forgot about that, Thanks !
Topic archived. No new replies allowed.