Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

prompt user for bool statement C++

#include <iostream>

using namespace std;

int main()
{
    bool aSmile, bSmile;
    cout << "a smiling ?" << endl;
    cin >> aSmile;
    cout << "b smiling ?" << endl;
    cin >> bSmile;
    if (aSmile && bSmile == true)
        cout << "problem";
    else
        cout << "no problem";
    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #prompt #user #bool #statement
ADD COMMENT
Topic
Name
2+5 =