Ask Question
2 October, 17:05

How do I create a boolean variable identifier is raining with the value set to true?

+1
Answers (1)
  1. 2 October, 19:26
    0
    bool is_raining=true;

    or

    bool is_raining=1;

    Explanation:

    So to create a boolean variable of name is_raining and set it's value to be true. First you have to use the data type bool which tells the compiler that the variable is of type boolean it can only hold true or false.

    Write the name of the variable that is in our case is_raining. To set it's value to be true. We have to use assignment operator = and set it true or 1.

    Any value other than 0 is considered as true and 0 is considered as false.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “How do I create a boolean variable identifier is raining with the value set to true? ...” 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