Consider the following variable declarations and definations in C . (i) int var _ 9 =1 ; (ii) int 9 _ var =2; (iii) int + =3; Choose the correct statement w.r.t above variables.

Consider the following variable declarations and definations in C . (i) int var _ 9 =1 ; (ii) int 9 _ var =2; (iii) int + =3; Choose the correct statement w.r.t above variables. Correct Answer Both i. & iii. are valid

In C language, a variable name can consist of letters, digits and underscore i.e. _ . But a variable name has to start with either letter or underscore. It can't start with a digit. So valid variables are var_9 and _ from the above question. Even two back to back underscore i.e. __ is also a valid variable name. Even _9 is a valid variable. But 9var and 9_ are invalid variables in C.

Related Questions

Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, given as pseudo-code: P → D* E* D → int ID {record that ID.lexeme is of type int} D → bool ID { record that ID.lexeme is of type bool} E → E1 + E2 {check that E1.type = E2.type = int; set E.type := int} E → !E1 {check that E1.type = bool; set E.type := bool} E → ID {set E.type := int} With respect to the above grammar; which one of the following choices is correct?
If A = x% of y and B = y% of x, then which of the following is true?
What is the value of var? $var = 'HELLO WORLD!'; $var = ucfirst($var);