Question 84Asked in DSSSB PGT Computer Science (Technical), 11 Jul 2021

Which of the following statement(s) is/are correct regarding void keyword in C++?

Which of the following statement(s) is/are correct regarding void keyword in C++? I. To specify the return type of a function when it is not returning any value. II. To indicate an empty argument list to a function.
  1. AOnly I
  2. BOnly II
  3. CBoth I and II
  4. DNeither I nor II
Show answerHide answer

Correct answer: (C) Both I and II

Explanation

void is used as the return type of a function that returns nothing, and as in f(void) it shows an empty argument list.

From DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021

This is question 84 of DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021. 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.