CS301 – Fall 2001
Prof. Hartman
Homework #3
Due Monday, October 1st
by 5:00 pm
int
a, i, z;
cout
<< "Enter z (z>0): ";
cin
>> z;
for
(i=0; i<=z; i++)
{
a = i % 2;
if (a == 0)
cout << i << endl;
}
You may use the I/O routines from Carter’s book. Refer to the handout about using NASM with Windows and Visual C++
for links to the I/O files if you don’t have them. Hand in your program listing
and a sample run showing z=10. Explain in English what the program does. For
full credit you must turn in a well-commented listing including your name and
the problem number.