-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path06_headers and operators.cpp.cpp
More file actions
42 lines (32 loc) · 1.26 KB
/
06_headers and operators.cpp.cpp
File metadata and controls
42 lines (32 loc) · 1.26 KB
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
#include <iostream>
using namespace std;
int main() {
// cout<< "yo yo yo ";
int a = 4, b= 7 ;
cout << " operators in c++"<<endl;
cout << " follow are the types of operators in c++"<<endl;
//arithmetic operators
cout<< "the valur of a + b is "<< a+b<<endl;
cout<< "the valur of a - b is "<< a-b<<endl;
cout<< "the valur of a * b is "<< a*b<<endl;
cout<< "the valur of a % b is "<< a%b<<endl;
cout<< "the valur of a++ is "<< a++<<endl;
cout<< "the valur of a-- b is "<< a--<<endl;
cout<< "the valur of ++a b is "<< ++a<<endl;
cout<< "the valur of --a is "<< --a<<endl;
cout<<endl;
//comparison operators
cout<< "the value of a == b is "<< (a==b) << endl;
cout<< "the value of a != b is "<< (a!=b) << endl;
cout<< "the value of a >b is "<< (a>b) << endl;
cout<< "the value of a < b is "<< (a<b) << endl;
cout<< "the value of a <= b is "<< (a<=b) << endl;
cout<< "the value of a >= b is "<< (a>=b) << endl;
cout<<endl;
//logical operator
cout<<"the following are the logical operators in c++"<< endl;
cout <<"the value of logical and operator is: ((a==b) && (a<b)) "<<((a==b) && (a<b))<<endl;
cout <<"the value of logical or operator is: ((a==b) || (a<b)) "<<((a==b) || (a<b))<<endl;
cout <<"the value of logical not operator is: (!(a==b) ) "<<(!(a==b))<<endl;
return 0 ;
}