Write the syntax of a for loop.
Answers
Answered by
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
Math,
4 months ago
Social Sciences,
4 months ago
Computer Science,
9 months ago
Computer Science,
9 months ago
Math,
11 months ago
Chemistry,
11 months ago
Math,
11 months ago