Ask Question
23 February, 12:30

Which of the following are valid C+ + identifiers?

a. new-Assignment

b._nextQuiz

c. 3rdProject

d.$twoHundred

e. CPP_Project

f. OneInchIs2.2Centimeters

g. Weekly Quiz

h. Jack'sHomework

i. first#

j. overPayment

+2
Answers (1)
  1. 23 February, 13:35
    0
    option (e) and option (j) are valid C+ + identifiers.

    Explanation:

    The valid identifier are those which follow all the rules of identifier.

    In option (a) i. e new-Assignment - is used between the declaration of identifier which do not follow the rule of identifier. So option (a) is invalid.

    In option (b) The _ is used in starting position to declared a variable which do not follow the rule of identifier because the variable must start with alphabet. So option (b) is invalid.

    So option (c) is invalid because the variable is start with the digit which do not follow the rule of identifier because the variable must start with alphabet. So option (c) is invalid.

    So option (d) is invalid because the variable is start with the doller which do not follow the rule of identifier because the variable must start with alphabet. So option (d) is invalid.

    In option (f) The dot (.) is used to declared a variable which do not follow the rule of identifier. So option (f) is invalid.

    In option (g) The space is used to declared a variable which do not follow the rule of identifier So option (g) is invalid.

    In option (h) The single quotes is used to declared a variable which do not follow the rule of identifier So option (h) is invalid.

    In option (i) The # is used to declared a variable which do not follow the rule of identifier So option (i) is invalid.

    so option (e) and option (j) are valid identifier.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following are valid C+ + identifiers? a. new-Assignment b._nextQuiz c. 3rdProject d.$twoHundred e. CPP_Project f. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers