Code:
#include<stdio.h>
int main(void)
{
double Yeild, Heads, Seedhead, Size, unit;
printf("Please enter 1 for US customary Units or 2 for metric units: ");
scanf("%lf", &unit);
if(unit=1)
{
printf("Please give the number of heads per square foot: ");
scanf("%lf", &Heads);
printf("Please input the number of seeds per head: ");
scanf("%lf", &Seedhead);
printf("Please idicate the number of seeds per pound: ");
scanf("%lf", &Size);
Yeild= 726*Heads*(Seedhead/Size);
printf("The potential grain yeild is: %.2f bushels/acre\n",Yeild);
return 0;
}
else(unit=2)
{ //*line 29
printf("Please give the number of heads per square meter: ");
scanf("%lf", &Heads);
printf("Please input the number of seeds per head: ");
scanf("%lf", &Seedhead);
printf("Please indicate the number of seeds per kilogram: ");
scanf("%lf", &Size);
Yeild= 726*(Heads*10.764)*(Seedhead/(Size/2.204));
printf("The potential grain yeild is: %.2f kg/ha\n",Yeild);
return 0;
}
} //* line 45
Comment