Saturday, 18 March 2017

Geeksforgeeks Solution For " Greatest of three numbers "

GeeksforGeeks Solution For School Domain .Below You Can Find The Solution Of Basic ,Easy ,Medium ,Hard .You Can Also Direct Submit Your Solution to Geeksforgeeks Same Problem .You Need to login then you can submit you answers 

Problem :- Write a program to find the greatest of the three numbers.

Submit Your Solution :- Click Here 


Solution :- 

#include <iostream>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
       int a,b,c;
       cin>>a>>b>>c;
       if(a>b&&a>c)
       cout<<a<<endl;
       else if(b>a&&b>c)
       cout<<b<<endl;
       else
       cout<<c<<endl;

    }
    return 0;
}

Output:-


Geeksforgeeks Solution For " Greatest of three numbers "

No comments:
Write comments

Recommended Posts × +