- 8
What are legal variables names given below? 1.*!is_legal 2.think_is_legal 3.13legal_name 4.notLegal
6 Respuestas
+ 4
The second and the last are legal, the other two ain't.
(1. Has special characters, 3. Starts with a number.)
- The variables names can't start with a number.
* example (legal): var69_a
* example (illegal): 69var_a
- The variables names can't have any special characters ($, @, !, ?, &, *......) except an underscore '_'.
* example (legal): snake_1
* example (illegal): $nake#1
- The variables names shouldn't contain a keyword or a reserved word (return, int, cout, while...).
* example (illegal): if_else_vn
+ 3
2.think_is_legal
4.notLegal
+ 1
just run the code and if it compiles without error it is valid 😜😜😜 !!!
Remember:
1. A variable cannot start with a number .
2. It cannot have and special character except underscore _ .
3. It should not contain any keyword or reserved word !!!
0
think is legal
and
notLegal
- 1
- 2
1. Illegal
2. Legal
3. Illegal
4. Legal