# Answer to Question #22579 in C++ for Eddy jutt

Question #22579

write a program that takes N numbers as input.it displays total positive and negative numbers

Expert's answer

#include <iostream>

using namespace std;

int main()

{

cout << "enter number n " << endl;

int n;

cin>>n;

int a[n];

& cout << "enter all numbers"<<endl;

for(int i=0;i<n;i++)

{

& cin>>a[i];

}

for(int i=0;i<n;i++)

{

& if(a[i]>0){cout<<"positive:"<<a[i]<<endl;}

if(a[i]<0){cout<<"negative:"<<a[i]<<endl;}

}

return 0;

}

using namespace std;

int main()

{

cout << "enter number n " << endl;

int n;

cin>>n;

int a[n];

& cout << "enter all numbers"<<endl;

for(int i=0;i<n;i++)

{

& cin>>a[i];

}

for(int i=0;i<n;i++)

{

& if(a[i]>0){cout<<"positive:"<<a[i]<<endl;}

if(a[i]<0){cout<<"negative:"<<a[i]<<endl;}

}

return 0;

}

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment