fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. double i, c; //i=items c=cost
  5. int main() {
  6. double d, m ,p;
  7. d = 0.0;
  8. m = 0.0;
  9. p = 0.5;
  10. cout << "Enter doughnuts bought:" << endl;
  11. cout << "Enter muffins bought" <<endl;
  12. cin >> d;
  13. cin >> m;
  14. i = d + m;
  15. c = i * p;
  16. cout << "Amount of items bought = " << i << endl;
  17. cout << "Total cost of items = $" << c << endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 4512KB
stdin
Standard input is empty
stdout
Enter doughnuts bought:
Enter muffins bought
Amount of items bought = 0
Total cost of items = $0