Which of the following will store the letter H in a Character variable named initial?

initial = 'H'
initial = 'H';

The correct answer is: A. initial = ‘H’

Option B,

448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zm-317.5 213.5V175.2l142.7 81.2-142.7 81.2z"/> Subscribe on YouTube
C, and D are all incorrect because they use double quotes around the letter H. This will store the string “H” in the variable initial, not the letter H.

When you assign a value to a variable, you need to use single quotes if the value is a single character. If the value is a string, you need to use double quotes.

In this case, the value we want to assign to the variable initial is the letter H. The letter H is a single character, so we need to use single quotes around it.

Therefore, the correct way to assign the letter H to the variable initial is:

initial = 'H'

Exit mobile version