Q.3 Quiz, 4 4 should be o/p

4 4 should be the o/p.
But there is no such option given. Why ? The it will go from lb to ub - 1 bcoz the condition is it!=ub, so the last 4 will not be printed.

hi @namandubey20, upper bound Returns an iterator pointing to the first element in the range [first,last) which compares greater than val . thus it will return the pointer to the first occurence of 5 .
thus the correct output should be 4 4 4

In case of any doubt feel free to ask :slight_smile:
If you got the answer then mark your doubt as resolved

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.