Desc :
bool 논리형
Source Code :
#include <iostream>
using namespace std;
int main()
{
int x = 10;
int y = 6;
bool is_true = false;
if (x > y)
{
is_true = true;
}
else
{
is_true = false;
}
if (is_true == true)
{
cout << "x는 y보다 크다 " << endl;
}
else
{
cout << "x는 y보다 작다" << endl;
}
return 0;
}
Result :
'C++' 카테고리의 다른 글
[C++] 027 쉼표 연산자 (0) | 2021.03.18 |
---|---|
[C++] 026 조건부 삼항 연산자 (0) | 2021.03.18 |
[C++] 019 실수형 변수 (0) | 2021.01.24 |
[C++] 018 정수형 변수 (0) | 2021.01.24 |
[C++] 017 문자열형 변수 (0) | 2021.01.24 |