function [x, y] = minimax(A)
x = max(A);
y = min(A);
fprintf('The maximum number is %d\n',x(A));
fprintf('The minimum number is %d\n',y(A));
end
This is the code i wrote for this question, but it is showing:-
Index exceeds the number of array elements. Index must not exceed 2.
Error in minimax (line 4)
fprintf('The maximum number is %d\n',x(A));
Can someone spot my mistake ?