C | Operators | Question 9
Output of following program?
#include <stdio.h> int f1() { printf ("Geeks"); return 1;} int f2() { printf ("Quiz"); return 1;} int main() { int p = f1() + f2(); return 0; } |
chevron_right
filter_none
(A) GeeksQuiz
(B) QuizGeeks
(C) Compiler Dependent
(D) Compiler Error
Answer: (C)
Explanation: The operator ‘+’ doesn’t have a standard defined order of evaluation for its operands. Either f1() or f2() may be executed first. So a compiler may choose to output either “GeeksQuiz” or “QuizGeeks”.
Recommended Posts:
- Operators in C | Set 2 (Relational and Logical Operators)
- C | Operators | Question 26
- C | Operators | Question 18
- C | Operators | Question 7
- C | Operators | Question 4
- C | Operators | Question 3
- C | Operators | Question 24
- C | Operators | Question 27
- C | Operators | Question 6
- C | Operators | Question 5
- C | Operators | Question 17
- C | Operators | Question 23
- C | Operators | Question 27
- C | Operators | Question 22
- C | Operators | Question 13



