-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGreatestofNum.cpp
More file actions
42 lines (42 loc) · 976 Bytes
/
GreatestofNum.cpp
File metadata and controls
42 lines (42 loc) · 976 Bytes
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
// ================================================
// Language: C++ / Cpp
// Topic : [Nested -Condition]
// Problem : 👉👉 Greatest of num.
// Want : Take 3 positive integers input and print the Greatest of them
//
// ================================================
#include <iostream>
using namespace std;
int main()
{
int x, y, z;
cout << "Enter 1st Number ";
cin >> x;
cout << "Enter 2nd Number ";
cin >> y;
cout << "Enter 3rd Number ";
cin >> z;
if (x > y)
{
if (x > z)
{
cout << "Greatest number is " << x << endl;
}
else
{
cout << "Greatest number is " << z << endl;
}
}
else
{
if (y > z)
{
cout << "Greatest number is " << y << endl;
}
else
{
cout << "Greatest number is " << z << endl;
}
}
return 0;
}