Multiple choice general knowledge science & technology

variable names: 1.a n 2.a_n 3.a#n 4.5a 5.a5 6.integer 7.double which of them are not valid variable names as per any c compiler?

  1. 1 3 4 6

  2. 1 3 4 6 7

  3. 2 4 6

  4. 1 3 4 7

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

C variable names must start with a letter or underscore, and can only contain letters, digits, and underscores. Invalid names: 1 (starts with digit), 3 (contains #), 4 (starts with digit), 7 (double is a reserved keyword). Valid names: 2 (a_n with underscore), 5 (a5), 6 (integer is not a reserved word in C). Options 1,3,4,7 are all invalid.