Q. What will be the output of the following C code?
Code: #include <stdio.h>
int main()
{
int a[5] = {1, 2, 3, 4, 5};
int i;
for (i = 0; i < 5; i++)
if ((char)a[i] == '5')
printf("%d\n", a[i]);
else
printf("FAIL\n");
}
β
Correct Answer: (D)
The program will compile and print FAIL for 5 times