-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoriginalcalcu.cpp
53 lines (48 loc) · 1.11 KB
/
originalcalcu.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
#include <iostream>
using namespace std;
int add(int a , int b)//this is called function definition and
//in it these r called paramters/arguements
{
cout<<"here is your addition"<<a+b;
}
int sub (int a , int b)
{
cout<<"here is your subtraction"<<a-b;
}
int mutiply (int a, int b)
{
cout<<"here is your multiplication"<<a*b;
}
int divison (int a, int b)
{
cout<<"here is your divison"<<a/b;
}
int main()
{
int choicex , fnum , snum;
cout<<"enter 1 for addition\nenter 2 for subtraction\n
enter 3 for divison\n enter 4 for multiplication\n";
cin>> choicex;
cout<<"enter your first number\n";
cout<<"enter your second number";
cin>>fnum>>snum;
if (choicex==1)
{ // cout<<"here is your addition\n" << fnum+snum;
add(fnum,snum);//tthis is called function calling
}
else if(choicex==2)
{
// cout<<"here is your subtraction\n" << fnum-snum;
sub(fnum,snum);
}
else if (choicex==3)
{
// cout<<"here is yopur divison" << fnum/snum;
mutiply(fnum,snum);
}
else if (choicex==4)
{
// cout<<" here is your multiplication" << fnum*snum;
divison(fnum,snum);
}
}