Which of the following can be used as an identifier in both C and C++?

Options

  • A. class
  • B. return
  • C. student_count
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. student_count

Detailed Explanation

Answer: (C) student_count

An identifier is the name given to variables, functions, arrays and other user-defined entities.

student_count is a valid identifier in both C and C++ because it starts with a letter and contains only letters and underscore.

class is a C++ keyword and return is a keyword in both languages, so they cannot be used as normal identifiers.