Q. Which of the following identifier names are invalid and why?


(a) Serial_no.

(b) 1st_Room

(c) Hundred$

(d) Total Marks

(e) Total_Marks

(f) total-Marks

(g) _Percentage

(h) True


Answer:-

(a) Serial_no. : - Invalid because it contains special character dot (.)
(b) 1st_Room :- Invalid because starting with a digit
(c) Hundred$ :- Invalid because it contains special character $
(d) Total Marks :- Invalid because of space between them
(e) Total_Marks :- Valid identifier
(f) total-Marks :- Invalid because it contains special character -
(g) _Percentage :- Valid identifier
(h) True :- Invalid because it is reserved keyboard

6 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post