Ask Question

Assume that a bool variable isquadrilateral has been declared, and that an int variable, numberofsides has been declared and initialized. write a statement that assigns the value of isquadrilateral to true if numberofsides is exactly 4 and false otherwise.

+1
Answers (1)
  1. 7 April, 03:26
    0
    You should state the language you're using in these types of questions; here's an example in C++.

    bool isQuad;

    int sides;

    std::cout << "How many sides does the shape have?";

    std::cin >> sides;

    if (sides = = 4)

    isQuad = true;

    else

    isQuad = false;
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Assume that a bool variable isquadrilateral has been declared, and that an int variable, numberofsides has been declared and initialized. ...” 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