Posts

Showing posts from December, 2017

while statement in C programming

Image
        In the previous article, we have seen if, if....else Statement in C programming if you did not read the previous article you read it before proceeding further.        Loops are used to execute some block of statements repeatedly. It executes until termination condition gets executed. Types of loop statement are 1. if statement 2. while statement 3. do-while statement while statement            In while statement first the expression is tested. If true then program enters into the while loop and executes statements of while and after execution of all statements again condition is tested. If the condition is true then while loop again executed and it continues until the condition becomes false. If the condition becomes false the loop terminates and control comes out of while loop. The syntax for while statement: while(expression) { statement 1; statement 2; ...