Vector pop_back problem not getting exact output

#include <bits/stdc++.h>
using namespace std;

bool compare(int a,int b)
{
return a>b;
}
int main()
{
vector v;
int n;
cin>>n;

for(int i=0;i<n;i++)
{
    int temp;
    cin>>temp;
    v.push_back(temp);
}    

sort(v.begin(),v.end(),compare);  //sort(v.rbegin(),v.rend())



for(int i=0;i<n;i++)
cout<<v[i]<<" ";
cout<<"\n";

v.pop_back();


for(int i=0;i<n;i++)
cout<<v[i]<<" ";

cout<<"\n";

}

in this no change in output

Share code via CB ide and the test case you want to use so that i can see.

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.