|
& (and) 조건을 다 만족할때
| (or) 한개의 조건이라도 만족할때
<< 1. --------------------------------------------------
#include <iostream>
using namespace std;
int main(){
int i = 4 ;
if (i == 4 && i == 5)
cout << " && (and)일 경우" << endl;
if (i == 4 || i == 5)
cout << " || (or)일 경우" << endl;;
return 0;
}
----------------------------------------------
조건 한개라도 만족하므로 || (or)
결과값
: || (or)일 경우
<< 2.1 ---------------------------------------
#include <iostream>
using namespace std;
int main(){
int i = 4 ,j=5;
if (i == 4 && j == 5)
cout << " && (and)일 경우" << endl;
if (i == 4 || j == 5)
cout << " || (or)일 경우" << endl;;
return 0;
}
----------------------------------------------
조건 두개다 만족하므로 && (and)
조건 한개라도 만족하므로 || (or)
결과값
: && (and)일 경우
|| (or)일 경우
<< 2.3 ---------------------------------------
#include <iostream>
using namespace std;
int main(){
int i = 4 ,j=6;
if (i == 4 && j == 5)
cout << " && (and)일 경우" << endl;
if (i == 4 || j == 5)
cout << " || (or)일 경우" << endl;;
return 0;
}
----------------------------------------------
조건 한개라도 만족하므로 || (or)
결과값
:
|| (or)일 경우
'Program' 카테고리의 다른 글
아주 쉬운 에프터이펙트(After Effects) 3D 카메라 , 에펙 3D 애니메이션 만들기 UFO (0) | 2021.06.15 |
---|---|
IF 조건만족 (if - els if -else ) (0) | 2014.04.09 |
[Dreamweaver] 드림위버 Php, 사이트 설정 (2.ftp) (0) | 2013.07.29 |
[Dreamweaver] 드림위버 Php, 사이트 설정 (1.Local/Network) (1) | 2013.07.28 |
[Eclipse] 이클립스 브라우저 크롬 설정 변경 (0) | 2013.07.18 |