Danhae's Blog
2017년 4월 17일 월요일
bool식 : 짝수판별
#include <iostream>
using namespace std;
int main() {
int n;
for(int i=0;i<2;i++){
cout<<"Enter an integer : "; cin>>n;
cout<<"Is "<<n<<" an even number? ";
(n%2==0) ? cout<<"true"<<endl : cout<<"false"<<endl;
}
return 0;
}
댓글 없음:
댓글 쓰기
최근 게시물
이전 게시물
홈
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기