【发布时间】:2021-08-28 00:08:00
【问题描述】:
#include<stdio.h>
int main(){
int age;
printf("enter your age:");
scanf("%d",&age);
if(age>=18 || age<=70){
printf("you can drive");
}else{
printf("you cannot drive");
}
return 0;
}
我没有得到所需的输出 “输入你的年龄:你会开车”
【问题讨论】:
-
if(age>=18 && age<=70) -
||= 一个或另一个。&&= 一个又一个
标签: c if-statement conditional-statements operators