Skip to main content

Posts

Showing posts with the label do-while loop

While and Do while Loop in C Program #DOTC_Mdb

While and Do while Loop Lop in C Program. Hi Everyone, In Previous blogs we discussed about for loop and nested for loop with some programs. Today we will discuss about other loops that are while and do while loop in C program.  . To see how for loop and nested for loop is working you can see my below blogs for your reference. https://dheeraj60.blogspot.com/2020/06/loop-concept-in-c-with-examples-dotcmdb.html https://dheeraj60.blogspot.com/2020/06/nested-for-loop-with-simple-pattern.html Let’s start with while and do –while loop in C Program. Loop: A loop is mainly used for executing a block of statements repeatedly until a given condition gives false same as we discussed in for loop. But Syntax and process is different from For Loop. Let’s Understand While loop first with Syntax and how it works . While Loop: While loop evaluates the test expression inside the parenthesis ().If the expression is true, statements inside the body of while loop are executed. Then, test express...