메뉴 건너뛰기

Programing

C++ 프로그래밍

AND연산자

관리자2 2019.01.21 18:50 조회 수 : 84

#include<iostream>
using namespace std;
int main(int argc,char *argv[])
{
 int math =100;
 bool a = math >=90;
 bool b = math >=80&&math<90;
 bool c = math >=70&&math<80;
 bool d = math >=60&&math<70;
 bool f = math <60;
 cout<<"수 = "<<a<<"\n";
 cout<<"우 = "<<b<<"\n";
 cout<<"미 = "<<c<<"\n";
 cout<<"양 = "<<d<<"\n";
 cout<<"가 = "<<f<<"\n";
}

------------------------------------------------------

AND연산자는 &&으로 표현한다.

위로