4.Logical operators
#include<stdio.h>
int main(){
int age,vipPass;
printf("Enter your age\n");
scanf("%d",&age);
printf("Enter 1 if you have vipPass:\n");
scanf("%d",&vipPass);
if(age>=18 && age<=90 || vipPass==1 && age!=1)
{
printf("You can drive\n");
}
else
{
printf("You can't drive!");
}
return 0;
}
Comments
Post a Comment