While Loop: Pre-Tested Loop
Introduction: While loop is a a pre-test loop, it first test a special conditional expression and as long as conditional expression is true , loop body statement will be executed. Syntax: while (condition) { //statement; incr/decr; } Flow chart: Step 1: In the execution flow, first initialized the value. Step 2: After initialized the value…