I'm a beginner to C++, and i've written a simple program to teach myself about for loops with a line counter. The for loop works fine, i see the numbers 1 to 150 stream down the page no problem, but alas, the line counter isnt working.
I expected to see when "counter" reaches 10, a blank line.. so i can have a blank line every 10 lines...But it doesnt seem to be doing Anything at all... I'm perplexed, I have looked at it and tried compiling with different compilers, with no luck.
Can anyone help me please?
Here's the code
// mucking about with the for loop.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int bush;
int counter;
counter = 0;
for(bush=1; bush <= 150; bush++)
cout << bush << "\n";