printf("How many meatball did you eat on day %d?\n",i);
int avg = totalBalls/5;
printf("You ate total of %d meatballs, on an %d meatballs per day!\n",totalBalls,avg);
in output total meatballs is coming very high in number and average too!. whats wrong in this code???
Post a Reply
|Oldest Newest Rating|
Suvendu kumar pati
· January 22, 2015
Its not showing any warning!
· January 23, 2015
i believe this should be your error:
also a word of warning:
int stands for integer, which, if you did not already know, means a whole number. in your line:
if variable totalBalls comes out as a number where 5 is not a completely divisible number, you will have an issue. what happens if totalBalls is 13?
it also seems you have a fencepost error...
One of the most popular languages of all time.
|Bucky Roberts Administrator|