Question 39Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)

What is the output of the following code? void func(void);

What is the output of the following code? #include <stdio.h> void func(void); int main() { func(10); return 0; } void func(void) { printf("Function called\n"); }
  1. ACompilation error
  2. BCompiles successfully but no output displayed
  3. CPrints 'Function called'
  4. DPrints 'Function not called'
Show answerHide answer

Correct answer: (A) Compilation error

Explanation

func is declared as void func(void), so it takes no arguments. Calling func(10) passes an argument, which the compiler rejects as too many arguments.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 3 (5:00 PM)

This is question 39 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 3 (5:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.