You are viewing a single comment's thread. Return to all comments →
#include <stdio.h> int max(int arr[4]) { int maximum = arr[0]; for (int i = 1; i < 4; i++) { if (arr[i] > maximum) { maximum = arr[i]; } } return maximum; } int main() { int arr[4]; for (int i = 0; i < 4; i++) { scanf("%d", &arr[i]); } printf("%d\n", max(arr)); 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 →