data structures using should continue to repeat itself every iteration of the loop must make the condition to exit the loop approachable sowith every iterationthe loop variable must be updated updating the loop variable may include incrementing the loop variabledecrementing the loop variable or setting it to some other value likei += where is the loop variable note that every section of the for loop is separated from the other with semi-colon it is possible that one of the sections may be emptythough the semi-colons still have to be there howeverif the condition is emptyit is evaluated as true and the loop will repeat until something else stops it the for loop is widely used to execute single or group of statements for limited number of times the following code shows how to print the first numbers using for loop #include int main(int inprintf("\ enter the value of :")scanf("% "& )for( = ; <= ; ++printf("\ % " )return in the codei is the loop variable initiallyit is initialized with suppose the user enters as the value of then the condition is checkedsince the condition is true as is less than nthe statement in the for loop is executed and the value of is printed after every iterationthe value of is incremented when exceeds the value of nthe control jumps to the return statement programming example write program to determine whether given number is prime or composite number #include #include int main(int flag inumclrscr()printf("\ enter any number ")scanf("% "&num)for( = <num/ ; ++if(num% = flag = breakif(flag = printf("\ % is composite number"num)else printf("\ % is prime number"num)return output enter any number is prime number