-3
#include <iostream>

using namespace std;

int main()
{

    double number;

    while(number <= 100)
    {
        cout << number << endl;
        number++;
    }
    return 0;
}

I understand that I need to initialize the variable, but out of curiosity, why does the compiler print out this very small number at the beginning of the output?

Tas
  • 7,023
  • 3
  • 36
  • 51

1 Answers1

2

That because you not initialize value for number ... You can check cout<< number; before loop. You can see the output..

MAS. John
  • 582
  • 6
  • 22