|
From: rchavez <rc...@so...> - 2002-08-06 01:15:09
|
Hi,
Define doesn't work. I saw no evil so I tried your code & it works find
printing 0 to 20 by 2's, one per line. Does it not compile or not run
for you?
Rob
> 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
|