My issue
help
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t ;
cin>>t;
int N,X;
for(int i=0; i<t; i++){
cin>>N>>X;
if(10000 <= (N*X) <=99999){
cout<<"yes"<<endl;
}
else{
cout<<"no"<<endl;
}
}
return 0;
}
Learning course: Basic Math using C++
Problem Link: 7 Rings Practice Problem in - CodeChef
@aryandagar
u have to do it like this
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin >> t;
while(t--){
int n,x;
cin >> n >> x;
if( n*x >9999 && n*x <=99999) cout << "yes";
else cout << "no";
cout << endl;
}
return 0;
}
so in the answer if u see the condition its 10000 <= (NX) <=99999 but u declared it as a kind of constraint to fix it you will have to use the && operator which will put multiple condition in 1 if and it will only execute the true part if both the condition are true u can try learning more about operators which can help you fix these kind of issues so the true condition will be like this -
if (nx > 9999 && n*x <=99999)