bool型数据演示

//this program dispiay te ahlphabet
#include <iostream>
using namespace std;
int main()
{
    bool b;
 b = false;
 cout<<"b is"<<b<<"\n";
 
 b = true;
 cout<<"b is"<<b<<"\n";
 
 //a bool value can control the if statement
 if(b)cout<<"this is executed.\n";
 
 b = false;
 if(b)cout<<"this is not executed.\n";
 
//outcome of a relational operator is a true/false value
cout<<"10>9 is"<<(10>9)<<"\n";
 
 
   return 0;
}
posted @ 2019-12-20 12:18  aarin  阅读(241)  评论(0)    收藏  举报