I have same programm but sort Function shows error in VS code

I have same programm but sort Function shows error in VS code. when I use this too( #include ) then its working but In video no such thing?

for using sort function you have to include <algorithm> library
after this your code will run without error

it depend upon compiler whether sort is included in iostream library or not
that’s why sir’s code run

2 Likes

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.