Computer Science, asked by dhanishshukla0, 5 months ago

Q1. Write reasons for invalid variable names.​

Answers

Answered by parthu2011
4

Answer:

if you are pleased with answer in turn

please subscribe my youtube chanel(Ramakrishna Nallangari youtube channel) for my effort

search for  

Ramakrishna Nallangari in search box

of youtube

Explanation:

Variable name may not start with a digit or underscore, and may not end with an underscore. ... The following are examples of valid variable names: age, gender, x25, age_of_hh_head. The following are examples of invalid variable names: age_ (ends with an underscore)

Valid C variables are those which can be used in a program in accordance with the variable naming rules.

For eg:- variables like _marks,marks,MARKS,simple_interest etc. can be used for a program.

Because according to variable naming rules:

A variable cannot start with a number or numeric value like 1,2,3 etc.

No special characters can be used other than underscore(_). For eg :- ×*%#@ ., are prohibited in variable names.

A variable can only start with underscore or an alphabet(uppercase and lowercase boht are included).

So, valid variables follow the above all rules while invalid variables do not .

Examples of invalid variables names are :-

1name , name! , %age etc.

Hope you get my points .

Thanks for reading.

Answered by sairashi1656
2
Variable name may not start with a digit or underscore, and may not end with an underscore. ... The following are examples of valid variable names: age, gender, x25, age_of_hh_head. The following are examples of invalid variable names: age_ (ends with an underscore);Feb 1
Similar questions