Two Types of Loops in C Programming. 1. Entry controlled loop: In this type loop, the stated conditional is checked first and then the block of code is executed. It is also called as a pre-checking loop. There are two types of entry control loop: for loop
1 x 0 = 0 1 x 1 = 1 1 x 2 = 2 1 x 3 = 3 1 x 4 = 4 1 x 5 = 5 2 x 0 = 0 2 x 1 = 2 2 x 2 = 4 2 x 3 = 6 2 x 4 = 8 2 x 5 = 10 The nesting of for loops can be done up-to any level. The nested loops should be adequately indented to make code readable.
Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop in C programming checks its condition at the bottom of the loop.. A do...while loop is similar to a while loop, except the fact that it is guaranteed to
Post a Comment:
Showing 0 Comments: