Vidyalelo
C Programming · Q79

C Fundamentals

Programming · C Programming · question 79

Q79

What will be the output of the following C code? #include 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 ", a[i]); else printf("FAIL ");

A.
The compiler will flag an error
B.
The program will compile and print the output 5
C.
The program will compile and print the ASCII value of 5
D.
The program will compile and print FAIL for 5 times
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board