printf("\n\n\n Enter Pollutant Number >> ");
scanf("%d", &pilihan);
printf("\n Enter Number of Grams Emitted Per mile >> ");
scanf("%f", &g_m);
printf("\n Enter Odometer Reading (in miles) >> ");
scanf("%f", &o_m);
switch (pilihan)
{
case 1:
if ((o_m<=50000)&&(g_e<=3.4))
printf("\n Emissions Not Exceed Permitted Level Of 0.3 grams/mile.");
else if ((o_m<=50000)&&(g_e>3.4))
printf("\n Emissions Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m>50000)&&(g_e<=4.2))
printf("\n Emissions Not Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m>50000)&&(g_e>4.2))
printf("\n Emissions Exceed Permitted Level Of 0.31 grams/mile.");
break;
case 2:
if ((o_m<=50000)&&(g_e<=0.31))
printf("\n Emissions Not Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m<=50000)&&(g_e>0.31))
printf("\n Emissions Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m>50000)&&(g_e<=0.39))
printf("\n Emissions Not Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m>50000)&&(g_e>0.39))
printf("\n Emissions Exceed Permitted Level Of 0.31 grams/mile.");
break;
case 3:
if ((o_m<=50000)&&(g_e<=0.4))
printf("\n Emissions Not Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m<=50000)&&(g_e>0.4))
printf("\n Emissions Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m>50000)&&(g_e<=0.5))
printf("\n Emissions Not Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m>50000)&&(g_e>0.5))
printf("\n Emissions Exceed Permitted Level Of 0.31 grams/mile.");
break;
case 4:
if ((o_m<=50000)&&(g_e<=0.25))
printf("\n Emissions Not Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m<=50000)&&(g_e>0.25))
printf("\n Emissions Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m>50000)&&(g_e<=0.31))
printf("\n Emissions Not Exceed Permitted Level Of 0.31 grams/mile.");
else if ((o_m>50000)&&(g_e>0.31))
printf("\n Emissions Exceed Permitted Level Of 0.31 grams/mile.");
break;
default:
printf("\n Please key in the right number!!");
}}
I am getting the following errors.
Ali\Documents\Pelles C Projects\Assignment 3\main.c(3): warning #2181: Incorrect signature for entry-point 'main'; expected 'int __cdecl function(void)' but found 'void __cdecl function(void)'.
C:\Users\Ali\Documents\Pelles C Projects\Assignment 3\main.c(5): warning #2116: Local 'g_e' is used without being initialized.
Building Assignment 3.exe.
Done.