Showing posts with label factorial. Show all posts
Showing posts with label factorial. Show all posts

January 29, 2013

Loop Control- for loop in C++ (OOPs)



loop control statement banner of for loop in C++ (OOPs)

“for” loop is also structure control loop as program will run or execute if the initial condition is true otherwise it will terminate and program will run until some condition is fulfilled.

FORMAT:
for(expression1;expression2;expression3)
{
Statement1;
Statement2;
}

Loop Control- While & Do-while in C++ (OOPs)


loop control statements banner of while and do while loop in C++ (OOPs)

These are used for repeating some portion of the program either by specified number of times or until a particular condition is true.
1. while statement
2. do while statement
3. for loop