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.

Respuesta :

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;