Loops are very important concept in C language and any other programming language. Loops are important to convert the larger program to smaller ones. Loops are 'the sequence of statement which continues to execute until the desired condition is met.' There are 3 types of loops in C language : 1. for loop. 2. while loop. 3. do while loop. 1. for loop The syntax of for loop is " for(initialization;expression;increment/decrement)". For loop is also called as entry controlled loop , where we initialize statement, give condition, and update statement in a single line. The for loop statement will be executed until the condition evaluation is true. Whenever the condition fails the control skip the for loop. Flowchart of for loop. Simple program to print number from 1 to 10 using 'for loop'. #include <stdio.h> void main() { int i; for(i=0...
Do your Programming with ease with codeeit.
Comments
Post a Comment