Работает корректно, вывод: Minimum is -8 Index of minimum element is 5