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.
.
.
Click on the title for the solution
.
.
if (numberOfSides == 4)
{
isQuadrilateral = 1;
}
else
{
isQuadrilateral = 0;
}
.
Click on the title for the solution
.
.
This is the answer:
:
if (numberOfSides == 4)
{
isQuadrilateral = 1;
}
else
{
isQuadrilateral = 0;
}
Comments
Post a Comment