-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharithmeticopts.cpp
56 lines (46 loc) · 1.28 KB
/
arithmeticopts.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
/*Exp-3-Operators in C++*/
#include<iostream>
int a; int b;int sum;
int main()
{
/* '+' operator */
using namespace std;
std::cout<<"Enter first number:";
std::cin >>a;
std::cout<<"Enter second number:";
std::cin >>b;
sum= a+b;
std::cout<<"The sum is:"<<sum<<endl;
/* '-' operator */
using namespace std;
std::cout<<"Enter first number:";
std::cin >>a;
std::cout<<"Enter second number:";
std::cin >>b;
int diff= a-b;
std::cout<<"The difference is:"<<diff<<endl;
/* '*' operator */
using namespace std;
std::cout<<"Enter first number:";
std::cin >>a;
std::cout<<"Enter second number:";
std::cin >>b;
int product= a*b;
std::cout<<"The product is:"<<product<<endl;
/* '/' operator */
using namespace std;
std::cout<<"Enter first number:";
std::cin >>a;
std::cout<<"Enter second number:";
std::cin >>b;
int quotient= a/b;
std::cout<<"The quotient is:"<<quotient<<endl;
/* '%' operator */
using namespace std;
std::cout<<"Enter first number:";
std::cin >>a;
std::cout<<"Enter second number:";
std::cin >>b;
int remainder= a%b;
std::cout<<"The remainder is:"<<remainder<<endl;
}