LogiQuest
Back to Control Instructions
15

What will be the output of the program?

#include <stdio.h>

int main(void) {
    int count = 0, i, j;
    for (i = 0; i < 4; i++)
        for (j = 0; j < 4; j++)
            if (i == j) count++;
    printf("%d\n", count);
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.