Here is my PGM and i mention the error alos.. please suggest the reason for the error so that i will not repeat it...
Code:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <ctype.h>
int main()
{
char h,sex,c; /* Health , Sex and City */
int age;
printf(" Health Stat -- Excellent=E or Poor=P, Sex-- M , F City -- City=C or V=village and age");
scanf("%c %c %c %d",&h,&sex,&c,&age);
clrscr();
/* Condition 1st */
if((h=='E' && sex=='M') &&( c='C')&&( age>=25 && age<=35));
printf(" Premium is Rs 4 / Thousand and Policy amount can not exceed 2 lakhs");
/*Condition 2nd */
if((h=='E' && sex=='F') &&( c='C')&&( age>=25 && age<=35));
printf("The Premium is 3/thousand and policy can not exceed Rs.1 lakh");
/*3rd condition*/
if((h=='P' && sex=='M') &&( c='V')&&( age>=25 && age<=35));
printf(" Premium is 6/thosuand and policy can not exceed Rs.10000");
/* Condition 4th*/
else /* Misplace else in fuciton main ()*/
{
printf("person is not insured");
}
getch();
}