Largest of three Numbers in C++
Here you will get the program code of C++ program to find largest of three numbers. This is the basic example of if-else-if (conditional statement).
Example of C++ Program to find Largest of three Numbers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  | #include<iostream> using namespace std; int main()  {  int a,b,c;  cout<<"\nEnter the value of a : ";  cin>>a; cout<<"\nEnter the value of b : ";  cin>>b; cout<<"\nEnter the value of c : ";  cin>>c;  if((a>b) && (a>c))  { cout << "Largest Number between " << a << ", " << b <<", " <<c << " is: " << a; }  else if((b>a) && (b>c))  {  cout << "Largest Number between " << a << ", " << b <<", " <<c << " is: " << b;  }  else  cout << "Largest Number between " << a << ", " << b <<", " <<c << " is: " << c; }  | 
Output
Enter the value of a : 2
Enter the value of b : 7
Enter the value of c : 4
Largest Number between 2, 7, 4 is : 7
Check out our other C++ programming Examples