-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut6.cpp
More file actions
38 lines (31 loc) · 1.22 KB
/
tut6.cpp
File metadata and controls
38 lines (31 loc) · 1.22 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
#include <iostream>
using namespace std ;
// "endl" is used to jump in new line
int main()
{
int a=66 , b=33 ;
cout<< "Operator in c++: "<<endl ;
cout<< "Following are the opertaor in c++: "<<endl;
// Arithmetic operator are +,-,*,/,++,--,%
cout<< " the addition of a and b is:"<<a+b<<endl;
cout<< " the sub of a and b is:"<<a-b<<endl;
cout<< " the mul of a and b is:"<<a*b<<endl;
cout<< " the div of a and b is:"<<a/b<<endl;
cout<< " the value of a%b is:"<<a%b<<endl;
cout<< " the value of a++ is:"<<a++<<endl;
cout<< " the value of a-- is:"<<a--<<endl;
cout<< " the value of --a is:"<<--a<<endl;
cout<< " the value of ++a is:"<<++a<<endl;
cout<<endl;
cout<<"Folling out put show the comparision operator";
cout<<"the valus a == b : "<<(a==b)<<endl;
cout<<"the valus a != b : "<<(a!=b)<<endl;
cout<<"the valus a >= b : "<<(a>=b)<<endl;
cout<<"the valus a <= b : "<<(a<=b)<<endl;
cout<<"the valus a > b : "<<(a>b)<<endl;
cout<<"the valus a < b : "<<(a<b)<<endl;
// Logical operator
cout<<"the valus a != b : "<<((a==b) && (a<b))<<endl;
cout<<"the valus a != b : "<<((a==b) || (a<=b))<<endl;
cout<<"the valus a != b : "<<(!(a==b))<<endl;
}