Types of LOOPS
Types of C Loops There are three types of loops in C language that is given below: do while while for do-while loop in C The do-while loop continues until a given condition satisfies. It is also called post tested loop. It is used when it is necessary to execute the loop at least once (mostly menu driven programs). The syntax of do-while loop in c language is given below: do { //code to be executed } while (condition); Flowchart and Example of do-while loop while loop in C The while loop in c is to be used in the scenario where we don't know the number of iterations in advance. The block of statements is executed in the while loop until the condition specified in the while loop is satisfied. It is also called a pre-tested loop. The syntax of while loop in c language is given below: while (condition){ //code to be executed } Flowchart ...
Comments
Post a Comment