0

It doesn't compile, why?

#include <iostream>
#include <string>

using namespace std;

int main()
{
	
	for(int cnt1 = 0, int cnt2 = 10;  cnt1<10; ++cnt1, --cnt2)
	{
		cout << cnt1 << "--------Hello!---------" << cnt2 << endl;
	}
	
	system("PAUSE");
}
4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by WaltP
0

Good. Cuz the answer would've been "Because you wrote it wrong"

Without details, and our lack of psychic ability, what else could we say?

0

Without details, and our lack of psychic ability, what else could we say?

I could say:
1. the declaration of the variables in the loop is wrong, there's an int to many.

2. <cstdlib> has to be included for system() ;)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.