Learn C programming in Bengali

Using Nested Loops

Submitted by tushar pramanick on Tue, 03/05/2013 - 20:14

Using Nested Loops

You can put a loop inside another one to make nested loops. The computer will run the inner loop first before it resumes the looping for the outer loop.

Listing 7.7 is an example of how nested loops work.

 

The do-while Loop

Submitted by tushar pramanick on Tue, 03/05/2013 - 20:09

The do-while Loop

You may note that in the for and while statements, the expressions are set at the top of the loop. However, in this section, you're going to see another statement used for looping,

The while Loop

Submitted by tushar pramanick on Tue, 03/05/2013 - 20:03

The while Loop

The while statement is also used for looping. Unlike the situation with the for statement, there is only one expression field in the while statement.

The general form of the while statement is

while (expression) {