18.1 A Simple if-statement
Write a program that defines a boolean variable whose value is false. Use the variable as the condition inside the
if-statement.
int main()
{
bool mycondition = false;
if (mycondition)
{
std::cout << "The condition is true." << '\n';
}
else
{
std::cout << "The condition is not true." << '\n';
}
}
18.2 Logical Operators
Write a program that defines a variable of type int. Assign the value of 256 to the variable. Check if the value of this variable is greater than 100 and less than 300. Then, define a boolean ...