#include<stdio.h>
#define SHIP_COST 7.00
#define FREE_SHIP_LIMIT 25.00
main ()
{
float BP = 0;
float numBooks=0;
float Avg = 0;
float Total = 0;
while (BP != -1)
{
printf("please enter the price of book: %d", BP);
scanf("%d", &BP);
Total += BP * 1.05;
numBooks++;
}
Avg= Total/numBooks;
printf("the average is %f", Avg);
printf("The total price is %f", Total);
}
given my code, when i compile it, i get a very very weird output. it'll print out the first printf but with a 0 infront of it. Also, when i run the code and enter "-1" the loop doesnt end and sometimes, it infinitely prints out" please enter the price of book" Please help as much as possible. I've never had this problem before.