C++ if Statement Question

Question

Write a program that defines a boolean variable whose value is false.

Use the variable as the condition inside the if-statement.

You can use the following code structure.

#include <iostream> 

int main() 
{ 
    //your code here
} 


#include <iostream> 

int main() 
{ 
    bool mycondition = false; 
    if (mycondition) 
    { 
        std::cout << "The condition is true." << '\n'; 
    } 
    else 
    { 
        std::cout << "The condition is not true." << '\n'; 
    } 
} 



PreviousNext

Related