Ask Question
8 August, 03:29

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

+4
Answers (1)
  1. 8 August, 03:35
    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?
Find 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 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