-
Notifications
You must be signed in to change notification settings - Fork 0
/
task02.cpp
70 lines (50 loc) · 1.14 KB
/
task02.cpp
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
using namespace std;
void add(int number1,int number2);
void multiply(float number1,float number2);
void division(float number1,float number2);
void sub(int number1,int number2);
main(){
char operation;
int number1,number2;
while(true){
cout<< "Enter your 1st number :";
cin>>number1;
cout<<"Enter your 2nd number";
cin>>number2 ;
cout <<"enter your operation (+, -, *, /, ) : ";
cin>>operation;
if(operation=='+'){
add (number1,number2);
}
if(operation=='-'){
sub (number1,number2);
}
if(operation=='*')
{
multiply(number1,number2);
}
if(operation=='/'){
division(number1,number2);
}
}
}
void add(int number1,int number2){
int sum = number1 + number2;
cout <<"your sum is "<<sum <<endl;
}
void multiply(float number1,float number2)
{
int multi = number1 * number2;
cout <<"your multiply is "<<multi <<endl;
}
void division(float number1,float number2)
{
int divi = number1 / number2;
cout <<"your division is "<<divi <<endl;
}
void sub(int number1,int number2)
{
int subtract = number1 - number2;
cout <<"your subtraction is is "<<subtract <<endl;
}