Can anyone explain this?

Expression 1: cout<<endl;
Expression 2: cout<<”\n”<<flush;

Both are same or different thing?

They are equivalent

For a better reference: https://www.google.com/amp/s/www.geeksforgeeks.org/endl-vs-n-in-cpp/amp/