Sunday, August 2, 2009

In C++ I need to know what all of this code does every line documented and each loop specifically defined.help

#include %26lt;iostream%26gt;


using namespace std;





void main ()


{//begin main





//declare and initialize











int counter = 1;


int counter2 = 1;


int counter3 = 1;





//Process and Output








//For Loop: //test before





cout %26lt;%26lt; "The For loop output is:" %26lt;%26lt; endl;


for(counter = 1; counter %26lt;= 10; counter++)


{


cout %26lt;%26lt; "Loop counter is at " %26lt;%26lt; counter %26lt;%26lt; endl;


}





//While Do Loop: //test before





cout %26lt;%26lt; "The While Do loop(test before) output is:" %26lt;%26lt; endl;


while (counter2 %26lt;= 10)


{





cout %26lt;%26lt; "Loop counter2 is at " %26lt;%26lt; counter2 %26lt;%26lt; endl;


counter2 = counter2 +1;


}





//Do While loop: //test after








cout %26lt;%26lt; "The Do While(test after) loop output is:" %26lt;%26lt; endl;


do


{//begin loop





cout %26lt;%26lt; "Loop counter3 is at " %26lt;%26lt; counter3 %26lt;%26lt; endl;


counter3 = counter3 +1;





}//end loop


while (counter3 %26lt;= 10);





}//end main

In C++ I need to know what all of this code does every line documented and each loop specifically defined.help
lol!


No comments:

Post a Comment