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
English,
5 months ago
English,
5 months ago
Computer Science,
1 year ago
Math,
1 year ago
Chemistry,
1 year ago