-
Notifications
You must be signed in to change notification settings - Fork 0
/
operators.cpp
32 lines (29 loc) · 1.08 KB
/
operators.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
#include<iostream>
using namespace std;
int main()
{
int a= 4,b= 5;
cout <<"operator in c++:"<<endl;
cout <<"following are the types"<<endl;
//ARITHMETIC OPERATORS
cout<<"the value of a+b "<<a+b<<endl;
cout<<"the value of a-b "<<a-b<<endl;
cout<<"the value of a*b "<<a*b<<endl;
cout<<"the value of a/b "<<a/b<<endl;
cout<<"the value of a%b "<<a%b<<endl;
cout<<"the value of a++ "<<a++<<endl;
cout<<"the value of a-- "<<a--<<endl;
cout<<"the value of --a "<<--a<<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;
//logical operator
cout<<"the value of this logic & operator((a==b)&&(a<b)) is:"<<((a==b) &&(a<b))<<endl;
cout<<"the value of this logic or operator((a==b)&&(a<b)) is:"<<((a==b) ||(a<b))<<endl;
cout<<"the value of this logic not operator((!a==b)) is:"<<(!(a==b))<<endl;
return 0;
}