C
This commit is contained in:
15
DeitelC/Chapter3/ConditionalExpression.c
Normal file
15
DeitelC/Chapter3/ConditionalExpression.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int grade;
|
||||
printf("%s\n", "Enter your grade!");
|
||||
scanf("%d", &grade);
|
||||
if (grade >= 60) {
|
||||
printf("%s\n", "You passed!");
|
||||
|
||||
} else {
|
||||
printf("%s\n", "You failed!");
|
||||
printf("%d\n", grade);
|
||||
}
|
||||
printf((grade <= 60) ? "Fail" : "Passed");
|
||||
}
|
Reference in New Issue
Block a user