#include
#include
void main()
{
int age;
char ms,sex;
clrscr();
printf("Enter Driver's Marital Status");
ms=getchar();
if(ms=='m')
printf("Driver is Insured");
else
{
fflush(stdin);
printf("Enter Driver's Sex");
sex=getchar();
printf("Enter Driver's Age");
scanf("%d",&age);
if((sex=='m' && age>30) || ( sex=='f' && age>25))
printf("Driver is Insured");
else
printf("Driver is not Insured");
}
getch();
}
/*Program to equidate D*/
#include
#include
void main()
{
int d,x,a,c;
clrscr();
printf("Enter value of x");
scanf("%d",&x);
printf("Enter value of a");
scanf("%d",&a);
printf("Enter value of c");
scanf("%d",&c);
if (x>0)
d=(x*x) - (4*a*c);
else
if (x==0)
d=15;
else
if(x<0)
d=((x*x*x) + (10*x*x) - 5);
printf("Value of D is = %d",d);
getch();
}
No comments:
Post a Comment