Consider the following ANSI C program.
#include <stdio.h>
int main()
{
int i, j, count;
count = 0;
i = 0;
for (j = –3, j <= 3; j++)
{
if ((j >= 0) && (i++))
count = count + j;
}
count = count + i;
printf(“%d”, count);
return 0;
}
Which of one of the following options is correct? 2021 SET 1 || MCQ || 1-mark
The program will compile successfully and output 10 when executed.
The program will not compile successfully.
The program will compile successfully and output 8 when executed.
The program will compile successfully and output 13 when executed.
This question is part of this quiz :
GATE|| C Programming & Data Structure || Pyqs (2010 to 2025 )