Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how do for loops on c++

for ( init; condition; increment ) {
   statement(s);
}

Example:

for ( i=0; i<5; i++ ) {
   cout<<"Hello World"<<endl; //Hello World is going to be print out 5 times
}
Source by courses.ms.wits.ac.za #
 
PREVIOUS NEXT
Tagged: #loops
ADD COMMENT
Topic
Name
7+7 =