Posts

Tut4 How to Install Code Block

Image

Tut3 Basic Structure of C Program in Hindi

Image

Tut2 How to Install C Language in Hindi

Image

Tut1 Introduction of C Language in Hindi

Image

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. ...

Type of Loop in C Programminig

Type of Loop We can classify the loop into two categories. They are: 1].     Pre-Tested Loop : When the control statement is placed at the beginning/top of the loop body is called Pre-Tested or Entry Controlled loop . These types of loop first check the given condition then execute the body of a loop.     Counter=Start Value Loop (condition) {             Statement 1 . . . . . . . . . Statement N Counter Update } Example: - for loop, while loop             2].     Post-Tested Loop : When the control statement is placed at the end/bottom of the loop body is called Post-Tested or Exit Controlled loop . This type of loop first executes the body of a loop then check the given condition. Counter=Start Value Loop {              ...