Last index hint(error)why
Hi @Saksham12
Small error you have made while taking input from user. It should be cin>>a[i]; you are using n instead of i that is why your code is giving wrong ans.
Hi @Saksham12
Small error you have made while taking input from user. It should be cin>>a[i]; you are using n instead of i that is why your code is giving wrong ans.