//Patriche Robert Cosmin #include #include #include using namespace std; int trovaPosizioneMassimo(int arr[], int size); int main() { const int DIM = 15; int numeri[DIM]; srand(time(0)); cout << "Array: "; for (int i = 0; i < DIM; i++) { numeri[i] = rand() % 100 + 1; cout << numeri[i] << " "; } cout << endl; int posizione = trovaPosizioneMassimo(numeri, DIM); cout << "La posizione del valore massimo รจ: " << posizione << endl; return 0; } int trovaPosizioneMassimo(int arr[], int size) { int massimo = arr[0], posizione = 0; for (int i = 1; i < size; i++) { if (arr[i] > massimo) { massimo = arr[i]; posizione = i; } } return posizione; }