You are viewing a single comment's thread. Return to all comments →
here its code in c++
class kk
{
private:
int arr[10000],num,i,counter,student;
public:
void read() { // cout<<" ENTER HOW MANY NUMEBR TO BE ENTER : "; cin>>num; //cout<<" STUDENT TO BE ALLOW : "; cin>>student; for(i=1;i<=num;i++) { // cout<<" ENTER NUMBER "<<i<<" : "; cin>>arr[i]; } } void compute() { counter=0; for(i=1;i<=num;i++) { if(arr[i]<=0) { counter++; } } } void display() { if(counter>=student) { cout<<"NO"; } if(counter<student) { cout<<"YES"; } }
};
int main()
class kk obj; int num,i;
// cout<<" TEST CASES : ";
cin>>num; for(i=1;i<=num;i++) { obj.read(); obj.compute(); obj.display(); cout<<"\n"; } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Angry Professor
You are viewing a single comment's thread. Return to all comments →
here its code in c++
class kk
{
private:
public:
};
int main()
{
// cout<<" TEST CASES : ";
}