Ask Question
21 August, 11:49

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')

+2
Answers (1)
  1. 21 August, 14:29
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers