C++ Program To Find Min Max Of Two Integer Numbers - letsbug
This is how to find minimum and maximum of two integer numbers in cpp using inline function and conditional operators. Nothing much in here very simple program
code:
#include<iostream>using namespace std;int main(){int a,b,min,max;cout<<"Enter two integer numbers: ";cin>>a>>b;min=a<b?a:b;max=a>b?a:b;cout<<"Min: "<<min<<endl;cout<<"Max: "<<max<<endl;system("pause");return 0;}
output:
output |
Comments
Post a Comment