Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e1af31d

Browse files
Add .cpp files
1 parent e888848 commit e1af31d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

‎04)operators.cpp‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int a = 5, b = 4;
7+
8+
cout << "Following are the Arithmetic operators:-" << endl;
9+
cout << a << " + " << b << " = " << a + b << endl;
10+
cout << a << " - " << b << " = " << a - b << endl;
11+
cout << a << " * " << b << " = " << a * b << endl;
12+
cout << a << " / " << b << " = " << a / b << endl;
13+
cout << a << " % " << b << " = " << a % b << endl;
14+
cout << a << "++ " << " = " << a++ << endl;
15+
cout << a << "-- " << " = " << a-- << endl;
16+
cout << "++" << a << " = " << ++a << endl;
17+
cout << "--" << a << " = " << --a << endl << endl;
18+
19+
cout << "Following are the Comparision operators:-" << endl;
20+
cout << a << " == " << b << " is " << (a == b) << endl;
21+
cout << a << " != " << b << " is " << (a != b) << endl;
22+
cout << a << " > " << b << " is " << (a > b) << endl;
23+
cout << a << " < " << b << " is " << (a < b) << endl;
24+
cout << a << " >= " << b << " is " << (a >= b) << endl;
25+
cout << a << " <= " << b << " is " << (a <= b) << endl << endl;
26+
27+
cout << "Following are the Logical operators:-" << endl;
28+
cout << "(a==b) && (a>b) is " << ((a == b) && (a > b)) << endl;
29+
cout << "(a==b) || (a>b) is " << ((a == b) || (a > b)) << endl;
30+
cout << "!(a==b) is " << (!(a == b)) << endl;
31+
32+
return 0;
33+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /