Given the array arr=[1 5 6 5 2], what will be printed on the…