Ask Question

Write a statement that toggles the value of the bool variable onoffswitch. that is, if onoffswitch is false, its value is changed to true; if onoffswitch is true, its value is changed to false.

+4
Answers (1)
  1. 6 September, 20:52
    0
    You should state the language you're using in these types of questions; here's an example in C++.

    bool onOff = true;

    if (onOff)

    onOff = false;

    else

    onOff = true;
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a statement that toggles the value of the bool variable onoffswitch. that is, if onoffswitch is false, its value is changed 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