Ask Question

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

+4
Answers (1)
  1. 13 July, 03:09
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers