Output has some issue

#include
#include <bits/stdc++.h>
using namespace std;
int main() {
int t ;
cin >> t ;
while(t–){
int n ; cin >> n ;
int price[n];
for(int i = 0 ; i < n ; i++){
cin >> price[i] ;
}
int m ;
cin >> m ;

    sort(price,price + n);
    int i = 0 ;
    int j = n-1 ;
   int min  = INT_MAX;
   int first = 0 ;
   int  second = 0 ; 
    while(i < j ){
         if(price[i] + price[j] == m){
             if(abs(price[i] - price[j]) < min){
                 min = abs(price[i] - price[j]);
                first = price[i] ;
                second = price[j];
                                }
             i++ ;
             j-- ;
         }
        else if(price[i] + price[j] > m ){
            j--;
        }
        else if(price[i] + price[j] < m ){
            i++ ;
        }
    }
    
    cout << "Deepak should buy roses whose prices are "<<first << " and " << second << endl ;
    
 } 
 cout << endl ;

}

please tell me my mistake

hi @priyansujha6_c05165365b683b54, add full stop in output and remove endl in line 42

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.