Home / MCQ Bank / Computer
Computer Fundamentals

What will be the output of the following C 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"); }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option D • The program will compile and print FAIL for 5 times

Related Computer Questions

Why is it expensive to use objects for the exception? What is the worst case time complexity of insertion operation(n =no. of candidates)? Which keyword when applied on a method indicates that only one thread should execute the method at a time. What is the purpose of the Java Collections Framework? Which of the following sorting algorithm is not stable ______