Math, asked by thanisha00, 6 months ago

Write a c++ program to find  largest from three numbers given by user . (using if else ladder)​

Answers

Answered by mreema2002
10

Step-by-step explanation:

#include <iostream>

using namespace std;

int main( )

{

int a,b,c;

cout<<"Enter three integers :";

cin>>a>>b>>c;

if(a>b && a>c)

cout<<a<<" is Largest"<<endl;

else if(b>a && b>c)

cout<<b<<" is Largest"<<endl;

else if(c>a && c>b)

cout<<c<<" is Largest"<<endl;

else cout<<"Two large numbers or all numbers are same"<<endl;

return 0 ;

}

Answered by Chaitanya1696
1

To find : c++ program for largest from three numbers given by user . (using if else ladder)​

#include <bits/stdc++.h>  

using namespace std;  

 

int main(){  

int a = 5, b = 10, c = 15;  

 

if (a >= b && a >= c)  

{  

 cout << a;  

}  

   else if (b >= a && b >= c)  

   {  

 cout << b;  

   }  

   else  

   {  

 cout << c;  

   }  

}

Similar questions