You are viewing a single comment's thread. Return to all comments →
using namespace std; int max_of_four (int n1, int n2, int n3, int n4); int main() { int a, b, c, d; cin >> a >> b >> c >> d; cout << max_of_four(a, b, c, d); } int max_of_four (int n1, int n2, int n3, int n4) { int max1 = n1 > n2 ? n1 : n2; int max2 = max1 > n3 ? max1 : n3; int max3 = max2 > n4 ? max2 : n4; return max3; }
Seems like cookies are disabled on this browser, please enable them to open this website
Functions
You are viewing a single comment's thread. Return to all comments →