What is an example of iteration in C?

What is an example of iteration in C?

a) if-else statement
b) for loop
c) switch statement
d) goto statement

Answer:

b) for loop

Explanation:

In C, a for loop is a common example of iteration, where a block of code is executed repeatedly based on a condition. Iteration structures like for, while, and do-while loops allow you to execute a statement or a group of statements multiple times, making them essential for tasks that require repetitive processing.

Understanding iteration is key to performing repetitive tasks efficiently in C programming.

Reference links:

https://www.rameshfadatare.com/learn-c-programming/

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top