C Programming - Decision Making -Looping
C Programming - Decision Making - Looping
In this tutorial you will learn about C Programming - Decision Making - Looping, TheWhile Statement, The Do while statement, The Break Statement, Continue statement andFor Loop.During looping a set of statements are executed until some conditions for termination of the loop is encountered. A program loop therefore consists of two segments one known as body of the loop and other is the control statement. The control statement tests certainconditions and then directs the repeated execution of the statements contained in the bodyof the loop.In looping process in general would include the following four steps1. Setting and initialization of a counter 2. Exertion of the statements in the loop3. Test for a specified conditions for the execution of the loop4. Incrementing the counter The test may be either to determine whether the loop has repeated the specified number of times or to determine whether the particular condition has been met.
The While Statement:
The simplest of all looping structure in C is the
while
statement. The general format of the while statement is:
while (test condition){body of the loop}
Leave a Comment