#include<stdio.h>
main()
{
char sex,ms;
int age;
printf ("Enter age, sex, marital status:");
scanf ("%d %c %c", &age, &sex, &ms);
if (ms=='M')
printf ("The driver is insured");
else
{
if (sex=='M')
{
if (age>30)
printf ("Driver is insured");
else
printf ("Driver is not insured");
}
else
{
if (age>25)
printf ("Driver is insured");
else
printf ("Driver is not insured");
}
}
}
main()
{
char sex,ms;
int age;
printf ("Enter age, sex, marital status:");
scanf ("%d %c %c", &age, &sex, &ms);
if (ms=='M')
printf ("The driver is insured");
else
{
if (sex=='M')
{
if (age>30)
printf ("Driver is insured");
else
printf ("Driver is not insured");
}
else
{
if (age>25)
printf ("Driver is insured");
else
printf ("Driver is not insured");
}
}
}
scanf ("%d %c %c", &age, &sex, &ms); this instruction is not working in visual studio 19.It is showing error like this scanf_s' : format string '%c' requires an argument of type 'unsigned int', but variadic argument 3 has type 'char .please resolve this issue
ReplyDelete