You are viewing a single comment's thread. Return to all comments →
#include <iostream> using namespace std; int hitungMax(int a, int b, int c, int d) { int as[] = {a, b, c, d}; for (int x = 1; x < sizeof(as) / sizeof(int); x++) { if (as[x] > as[0]) { as[0] = as[x]; } } return as[0]; } int main() { int a, b, c, d; cin >> a >> b >> c >> d; int result = hitungMax(a, b, c, d); cout << result << endl; return 0; }
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 →