Hackerrank C++ --- Functions

#include <iostream>
#include <cstdio>
using namespace std;




int main() {
    int a, b, c, d;
    cin>>a ; cin>> b ; cin>>c ;cin>> d ;
    int   e , f ;
  // variable = Expression1 ? Expression2 : Expression3
  e = a>b ? a : b ;
  f = c > d ? c:d ;
  int  ans = e > f ? e : f ;
  cout<<ans<< endl ; 
    
    
    return 0;
}

Comments

Popular posts from this blog

Infosys - Monster RPG GAME Sample Question Solution

Luck Balance Hackerrank

Find the Leader C++