#include
#include
int main()
{ char ms;
printf("Is Driver married (Y/N): ");
scanf("%c",&ms);
if(ms=='y'||ms=='Y') printf("\nDriver is insured.");
else if(ms=='n'||ms=='N'){ int age=0;
char g;
printf("Enter gender of Driver (M/F): \n");
scanf(" %c",&g); printf("Enter age of driver: ");
scanf("%d",&age);
if((g=='m'||g=='M')&&age>=30) printf("\n Driver is insured.");
else if((g=='f'||g=='F')&&age>=25) printf("\n Driver is insured.");
else if(g=='m'||g=='M'||g=='f'||g=='F') printf("\n Driver is not insured.");
else{ printf("Please enter a valid gender of driver.\n");
printf("Try again............");
}
}
else{ printf("\nPlease Enter valid information.");
printf("Try again...........");
}
getch();
return 0;
}