Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Solution to Question No.

3 :
Program:
/* Program to determine eligibility for insurance,premium and maximum
policy amount */
#include<stdio.h>
void main()
{
float age;
char health,place,sex;
clrscr();
printf("Enter age, sex, place and health of the person:");
scanf("%f %c %c %c",&age,&sex,&place,&health);
if (age>35 || age<25)
printf("The person is not insured");
else
{ if (place=='V')
{ if (sex=='F')
printf("The person is not insured");
else
{ if (health=='E')
printf("The person is not insured");
else
printf("The person is insured\nThe premium is Rs.6 per
thousand\nPolicy amount cannot exceed Rs. 10000");
}
}
else
{ if (health=='P')
printf("The person is not insured");
else
{ if (sex=='M')
printf("The person is insured\nThe premium is Rs.4 per
thousand\nPolicy amount cannot exceed Rs.2 lakhs");
else
printf("The person is insured\nThe premium is Rs.3 per
thousand\nPolicy amount cannot exceed Rs.1 lakh");
}
getch();
}
getch();
}
}

You might also like