Computer Science, asked by PRACHISHETTY2867, 9 months ago

Write the syntax of a for loop.

Answers

Answered by BrainlyYoda
8

Syntax for for loop :-

for (initializationStatement; testExpression; updateStatement)

{

   // statements inside the body of loop

}

What is loop? What are types of loop?

Loop is used to repeat of block of statements until the condition is met.

1. for loop

2. while loop

3. do...while loop

Example :-

for(int i = 0; i < 5 ; i++)

{

printf("Hello World");

}

This will print Hello World 5 times.

Similar questions