Advertisement
biswasrohit20

dog

May 14th, 2021
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. // Declearing variables
  7. int leash, collar, food, total;
  8. // taking input
  9. cout << "Enter the cost of a leash: ";
  10.  
  11. cin >> leash;
  12. cout << "Enter the cost of a collar: ";
  13. cin >> collar;
  14. cout << "Enter the cost of a bag of food: ";
  15. cin >> food;
  16. // adding three numbers
  17. total = leash + collar + food;
  18.  
  19. // displaying sum
  20. cout <<"The total amount spent is " << total << endl;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement