Saturday, April 28, 2012

9.20

Show how to imitate a while-statement in C/C++ with a do-statement.

int dowhile = 5;
do
{
if (dowhile > 0 == true)
{
cout << dowhile << endl;
dowhile--;
}
else break;
}
while(true);


No comments:

Post a Comment