Why is the output 0 in this case

@jsn853 hey ,it is printing 0 because v.end() represent the iterator which is equal to size of vector but as indexing of vector starts from 0 so last element will be v.end()-1 ,mtlb iterator 0 default value print kra rha hai last se next elment ki agr last print krana hai to use v.end()-1.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.