Calculate The Total of Ingredients
Calculate The Total of Ingredients
h>
int main(){
int qty;
int i=0;
//int j=0;
double pounds[qty];
double price[qty];
double total=0;
//printf("%.1lf\n", pounds);
}
for (i=0; i<qty; i++)
{
scanf("%lf", &price[i]);
//printf("%.1lf\n", price);
total = total + (pounds[i]*price[i]);
printf("%.6lf\n", total);
return 0;
}
Note: use just i, if I use i and j to calculate separately the Price and weight it
won´t give the expexted Output.
-------------------------------
int main()
{
int nbIngredients=0;
int i, idIngredient;
double price[10];
double totalPrice = 0.0;
double readPrice=0.0;
scanf("%d", &nbIngredients);
return 0;
}