Skip to content
doubtly

1 answer

Best answer

#include<iostream>

using namespace std;


int main()

{

    int num1, num2, max, min;


    cout<<"Enter two numbers:"; 

    cin>>num1>>num2;


    max = (num1 > num2) ? num1 : num2;

min = (num1 < num2) ? num1 : num2;


    cout<<"Maximum between "<<num1<<" and "<<num2<<" is "<<max<<endl;

    cout<<"Minimum between "<<num1<<" and "<<num2<<" is "<<min<<endl;


    return 0;

}


Output::

image


Doubtly · 8 Nov 2021 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.