Ask Question
17 April, 09:41

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

+3
Answers (1)
  1. 17 April, 12:56
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers