Help me in solving CSCV202A problem

My issue

why it is not working can anyone help me

My code

// Update the program below to solve the problem

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

int main() 
{
    int t;
    cin>>t;
    while(t--)
    { 
        int X,Y,A;
        //Accept 3 integers inputs.
        cin>>X>>Y>>A;    
        
        if(A >= X && A < Y){
            cout << "YES" << endl;
        }
        
        else{
            cout << endl << "NO";
        }

    }
    return 0;
}


   

Learning course: C++ for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone

@sagar_798
U should print endl after printing β€œNO”
I have corrected it in your code.

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

int main() 
{
    int t;
    cin>>t;
    while(t--)
    { 
        int X,Y,A;
        //Accept 3 integers inputs.
        cin>>X>>Y>>A;    
        
        if(A >= X && A < Y){
            cout << "YES" << endl;
        }
        
        else{
            cout << "NO"<<endl;
        }

    }
    return 0;
}
1 Like

Yes I got it. Btw thank uh for correcting me​:+1::+1:

1 Like