Write a Program to Find the Greatest of the Three Numbers.

C++// C++ program to find greatest // among three numbers using #include <iostream> using namespace std; int main() { int a = 10, b = 20, c = 30; cout << "The Greatest Among Three Numbers is : "; if (a >= b && a >= c) { cout << a << endl; } else if (b >= a && b >= c) { cout << b << endl; } else { cout << c << endl; } return 0; }

Output

The Greatest Among Three Numbers is : 30

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *