Which statement is valid?
Which statement is valid?
The valid statement is 'int totalScore2 = 0;'. In programming, variable names must begin with a letter, $ character, or underscore and can include numbers after the initial character. Option A ('int 2 totalScore = 0;') is invalid because it begins with a number. Option B ('int total–score = 0;') is invalid due to the dash character; the correct character for separation is an underscore (_). Option D ('int total score = 0;') is invalid because it contains a space. Therefore, option C ('int totalScore2 = 0;') is the correct and valid declaration.
Only valid option is C. variable names can start with letters, $, or _, but not with numbers.variable name can contain a number but not at start.
the correct answer is C .
CORRECT ANSWER IS C
answer is C
Beyond doubt, correct answer is C.
The correct answer is C
Hi, I can not understand why the answer ist A. Can you please explain it to me. Thank you
it's a wrong answer , the correct answer is C