Ask Question
2 October, 07:13

If chr is a character variable, which of the following if statements is written correctly? A. if (chr = "a") B. if (chr = = "a") C. if (chr = 'a') D. if (chr = = 'a')

+4
Answers (1)
  1. 2 October, 10:04
    0
    D. if (chr=='a')

    Explanation:

    Since chr is a character variable means it can only store a single character it could be any character. Characters are written in c+ + language using single quotes out of the other three statements two of them uses double quotes and the third uses assignment operator instead equal to operator. Double quotes are used for null terminated strings.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “If chr is a character variable, which of the following if statements is written correctly? A. if (chr = "a") B. if (chr = = "a") C. if (chr ...” 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