2079 3

BIT102 ยท 2079 ยท 10 marks

When do we use for loop and while loop? Compare the while and do while loop with suitable example.Write a program to find average, minimum and maximum age in a class of 20 students.[4+6]

When do we use for loop and while loop? Compare the while and do while loop with suitable example.Write a program to find average, minimum and maximum age in a class of 20 students.[4+6]

C ProgrammingChapter 5: Loops and IterationComparison of while and do while

--- Use a for loop when: - The number of iterations is known in advance - You have a clear initialization, condition, and increment/decrement - Iterating over arrays, ranges, or fixed counts Example: Use a while loop when: - The number of iterations is not known in advance - The loop continues ba...