Demorgans law for drivers
CAN YOU DRIVE ??
CONDITION :
IF YOU ARE DRUNK OR LESS THAN 18 , YOU CANT DRIVE :
SOL:
#include<stdio.h>
#include<math.h>
#include<stdbool.h>
int main(){
int age ;
bool yes ;
printf(" are you drunk ");
scanf("%d", &yes);
printf(" whats your age ");
scanf("%d", &age );
if ( yes==1 || age < 18){
printf(" you cant drive");
}
else if(yes==0&&age>=18)// ELECTRONICS ENGG KA FAYDA , DE MORGANS LAW FOR NOR !!!
{
printf(" you can drive");
}
return 0;
}
Comments
Post a Comment