Binary search-pivot element in sorted rotated array

Code:https://ide.codingblocks.com/s/111014
why am i not getting the right output?

hey @dvitiarora, you are getting right answer. That 1 is index of largest element and 6 is present at index=1.