+5

Which of the following are legal variable name in c++?

1:- name3_var 2:- 14var 3:- &*^var 4:- salary Note:-In this question has two answer

5/19/2019 2:40:35 PM

Ashish Mewada

10 Answers

New Answer

+12

1 and 4 are legal

+10

Variable names have to begin with an alphabetic character or _ and cannot contain special characters other than _ (underscore).

+5

The answer is 1&4 ..

+4

Option 1 and 4 are correct. No numbers allowed at the start of the var name No special characters except _ is allowed

+4

One and four(1 and 4)!

+3

1 & 4

+3

As replied above 1 and 4

+2

A variable name can start with alphabet and underscore only. It can't start with digit.

+2

+1

the dependent variable starts "int" or gives a value to a letter depending on the operation to be performed, example: sum