|
From: <tam...@ms...> - 2002-08-05 23:03:18
|
I have been tasked with a problem in my newbie manual to use a "for loop"=
and to console out by 2's from 0 to 20 here's what I have done and I was=
wondering 1st why it doesn't work and 2nd how do I make it work.
#include <iostream>
int main()
{
// --- iterate an integer by 2
for (int i =3D 0; i <=3D 20; i+=3D2){
std::cout << i << '\n'; =20
=20
}
// --- pause system
char end[5];
std::cin >> end;
return 0;
}
Thanks in advance
Danny
|