Aspire Faculty ID #16994 · Topic: AMU MCA 2022 · Just now
AMU MCA 2022

In the following program, how many times “for” loop will be executed?
#include <stdio.h>
int main()
{
    int i = 59, j = 10;
    for( ; j ; i )
        printf("%d", i);
}

Solution

Loop condition is j, which is non-zero and never changes. Hence the loop runs infinitely.

Previous 10 Questions — AMU MCA 2022

Nearest first

Next 10 Questions — AMU MCA 2022

Ascending by ID
Ask Your Question or Put Your Review.

loading...