Ask Question
27 April, 09:50

If the variable letter has been defined as a char variable, which of the following are not valid assignment statements to assign letter w to the variable?

A) letter = w;

B) letter = 'w';

C) letter = "w";

+5
Answers (1)
  1. 27 April, 12:16
    0
    The correct answer for the given question is option (A) and option (C).

    Explanation:

    To declared any variable of character we using following syntax

    char variable=' value';

    char letter='w';

    In option (A) their is no single quotes between character w. So this is not a valid assignment.

    In option (C) their is double quotes between character w, no single quotes between character w. So this is not a valid assignment.

    In option (B) their is single quotes between character w. So this is a valid assignment.

    So option (A) and option (C) are are not valid assignment statement.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “If the variable letter has been defined as a char variable, which of the following are not valid assignment statements to assign letter w ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers