Monday, August 1, 2016

INSURANCE- C Program

/*INSURANCE*/

#include<conio.h>
#include<stdio.h>
void main()
{char sex,ms,m,u,f;
int age;
clrscr();
printf("CODING: SEX= M OR F,\n MARTIAL STATUS: M OR U\n");
printf("Enter the sex,ms,age::");
scanf("%c %c %d",&sex,&ms,&age);
if((sex=='m' && ms=='m')||(sex=='m'&& ms=='u' && age>30)||(sex=='f' && ms=='u' && age>25))
{
printf("INSURED");
}
else
{
printf("NOT INSURED");
}
getch();
}


/************************OUTPUT***************************
CODING: SEX= M OR F,MARTIAL STATUS: M OR U
Enter the sex,ms,age ::M M 22
NOT INSURED */

No comments:

Post a Comment