C | Functions | Question 7
Predict the output?
#include <stdio.h> int main() { void demo(); void (*fun)(); fun = demo; (*fun)(); fun(); return 0; } void demo() { printf("GeeksQuiz "); } |
chevron_right
filter_none
(A) GeeksQuiz
(B) GeeksQuiz GeeksQuiz
(C) Compiler Error
(D) Blank Screen
Answer: (B)
Explanation: This is a simple program with function pointers. fun is assigned to point to demo. So the two statements “(*fun)();” and “fun();” mean the same thing.
Quiz of this Question
Recommended Posts:
- C | Functions | Question 11
- C | Functions | Question 2
- C | Functions | Question 3
- C | Functions | Question 4
- C | Functions | Question 8
- C | Functions | Question 6
- C | Functions | Question 9
- C | Functions | Question 5
- C | Functions | Question 11
- C | Functions | Question 10
- Python | Functions | Question 7
- Python | Functions | Question 6
- Java | Functions | Question 3
- Python | Functions | Question 5
- Java | Functions | Question 7



