-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBill_Splitter.cpp
More file actions
36 lines (26 loc) · 895 Bytes
/
Copy pathBill_Splitter.cpp
File metadata and controls
36 lines (26 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# include <iostream>
using namespace std ;
int main () {
// making a variable to store value of total bill
double totalbill;
// making a variable to store value of total persons
double totalpersons;
double billperperson;
// using to tell user to enter Total Bill Amount
cout << "Total Bill Amount = ";
// using to get input from user to know total amount of bill
cin >> totalbill;
// using to tell user to enter Total Persons
cout << "Total Persons = " ;
// using to get input from user to know total persons
cin >> totalpersons ;
if (totalpersons==0){
cout << "Error: Divison With Zero Is Not Allowed";
return 0;}
// making a variable to store value of bill per person
else {
billperperson = totalbill/totalpersons;}
// using to give output about bill per person
cout << "Total Bill Per Person = " << billperperson << endl;
return 0 ;
}