Aspire Faculty ID #16745 · Topic: AMU MCA 2025 · Just now
AMU MCA 2025

What is the output for the program given below?
#include <stdio.h>
void main()
{
    int i = 5;
    for (; i < 12; i++);
    printf("%d", i);
}

Solution

The semicolon ; after the for loop makes it an empty loop. The loop increments i until $i = 12$. After the loop ends, printf prints the final value of i.

Previous 10 Questions — AMU MCA 2025

Nearest first

Next 10 Questions — AMU MCA 2025

Ascending by ID
Ask Your Question or Put Your Review.

loading...