C++ Program to find maximum among two numbers [DEVCPP/GCC]


//Program to find maximum among two numbers

#include <iostream>

using namespace std;

int main()
{
float a,b,max;

cout<<"ENTER FIRST NUMBER: ";
cin>>a;
cout<<"ENTER SECOND NUMBER: ";
cin>>b;

max = (a>b) ? a : b ;
// Variable =  <condition>  ?  <True>  :  <False> 

cout<<"\nMAXIMUM AMONG "<<a<<" & "<<b<<" IS "<<max;

return 0;
}


Share this

Related Posts

:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:P
:o
:>)
(o)
:p
:-?
(p)
:-s
(m)
8-)
:-t
:-b
b-(
:-#
=p~
$-)
(y)
(f)
x-)
(k)
(h)
cheer

FIND US ON FACEBOOK!