How to find the min from two numbers with array and operators in C++

1 Answer

0 votes
#include <iostream>

using namespace std;

int min_2(int a, int b) {
   int arr[] = {a, b};
   
   return arr[a > b];
}


int main()
{
	cout << min_2(6, 2) << endl;
	
	return 0;
}


/*
run: 

2

*/

 



answered Mar 25, 2019 by avibootz
...