Title: Min max without using if else
Program:
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int a=14;int b=33;
cout<<"max:"<<((a+b)+abs(a-b))/2<<endl;
cout<<"Min:"<<((a+b)-abs(a-b))/2<<endl;
return 0;
}
Easy programming and better way to learn the programming . if you like the scorce code do like like share and subscribe the chennel.
No comments:
Post a Comment