While Loop in C Programming & Examples
1].while Loop The simplest looping structure in C language is while loop. It is Entry Controlled loop statement. Syntax:- Loop Variable=Value; while (condition) { Statement 1; . . . . . . . . . . . . . . . . . . Statement N; Loop Variable Update } 1. The condition returns boolean value either true or false. If the given condition return true then the body of loop is execute. After the execution of loop body it again tests the given condition and if it is true it again execute the body of loop. This process repeat until the condition remains true. 2. When the condition returns false, the control is transferred from out of the loop. The program will continue with the statements which are after the while loop. 3. The body of loop contains one or more statements. The braces are required only if the body contains the two or more statements. ...