Help with blank outputs in while loops

I'm currently trying to create a while loop where the output will count by 2s until it matches the input by the user. Here is the code I have so far.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 int main()
{
    int input = 0;
    int count = 0;
    cout << "Enter a value: ";
     cin >> input;
    
    while (count < input)
    { 
     count +=2;
     cout << count;
    
   } 
}


It's probably a really easy fix.. but I've been staring at it for an hour now and I cannot get it to work.
What blank outputs are you talking about? I ran it and other than not outputting 0 at the begging which his a super easy fix it works fine. Can you elaborate on the problem?
Hi,

Please always post all of the code, don't leave out the include statements or other important stuff.

So the program prints a long number, what is the cause of that? Is there a pattern in the number printed? What is a simple thing to do to fix it?

Topic archived. No new replies allowed.