Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- float avgProfit;
- int priceOfPumpkin = 10;
- int sales = 59;
- int daysWorked = 7;
- //wont work
- avgProfit = ( priceOfPumpkin * sales) / daysWorked;
- //temporarily changes ints to floats
- avgProfit = ( (float)priceOfPumpkin * (float)sales) / (float)daysWorked;
- printf("Age daily profit of: $%.2f", avgProfit);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement