Ask 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 to the variable?

A) letter = w;

B) letter = 'w';

C) letter = "w";

+4
Answers (1)
  1. 6 July, 22:48
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers