#include
#include
void main()
{
clrscr();
char a[20],s;
int age,m;
printf("\nENTER THE NAME OF THE DRIVER : ");
gets(a);
printf("\nENTER THE AGE OF DRIVER : ");
scanf("%d",&age);
printf("\nENTER THE SEX OF THE DRIVER (M- MALE, F-FEMALE) : ");
scanf("%s",&s);
printf("\nENTER THE MARITAL STATUS OF THE DRIVER(0-MARRIED, 1-UNMARRIED): ");
scanf("%d",&m);
if(m==0)
printf("\nDRIVER IS INSURED");
else if(m==1 && s=='M' && age>=30)
printf("\nDRIVER IS INSURED");
else if(m==1 && s=='F' && age>=25)
printf("\nDRIVER IS INSURED");
else
printf("\nDRIVER IS NOT INSURED");
getch();}
ALGORITHM
· Start
· Declare a[20],s as character
· Declare m as an integer
· Write(“name of driver”)
· Read(“name of driver”)
· Write(“age of driver”)
· Read(“age of driver”)
· Write(“sex of the driver”)
· Read(“sex of driver”)
· Write(“marital status”)
· Read(“marital status”)
· if(age==0)
if(m==1 && s=='M' && age>=30)
if(m==1 && s=='F' && age>=25)
· Write(“driver insured”)
· Else
· Write(“driver not insured”)
· Stop
c code samples for programmers
ReplyDeletec program Graphical Calculator Design