Notice
Recent Posts
Recent Comments
Creative Code
passFail3.c(합격,실패 판별 삼항연산자) 본문
#include <stdio.h>
//삼항연산자 ?
int main(void)
{
int score;
printf("input score :");
scanf("%d",&score);
/*
if (score>=60){
//pass
printf("score : %d --- pass \n",score);
} else {
//fail
printf("score : %d --- fail \n",score);
}
*/
printf("score : %d --- %s\n",score,(score >= 60) ? "pass" : "fail");
return 0;
}
'C Programming' 카테고리의 다른 글
printA2Z.c(A부터 Z까지 출력) (1) | 2023.08.01 |
---|---|
posZeroNeg2 (양수,음수,0 판단 삼항연산자) (0) | 2023.08.01 |
ordinaryLeap3.c(윤년,평년 판별 삼항연산자) (0) | 2023.08.01 |
oddEven3.c(홀수,짝수 판단 삼항연산자) (1) | 2023.08.01 |
multiplyTable.c (구구단) (0) | 2023.08.01 |