60 430
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #22581 in C++ for Eddy_ jutt

Question #22581
write program that takes n numbers as input. it displays total positive and negative numbers.
Expert's answer
#include <conio.h>
#include <iostream>

using namespace std;

void main()
{
int n;
int number;

int positiveNumberCount = 0;
int negativeNumberCount = 0;

cout << "Enter the count of numbers: ";
cin >> n;

cout << "Enter " << n << " integer numbers:" << endl;
for (int c = 0; c < n; c++)
{
cin >> number;
if (number > 0)
positiveNumberCount++;
if (number < 0)
negativeNumberCount++;
}

cout << endl;
cout << "There is " << positiveNumberCount << " positive and " <<
negativeNumberCount << " negative number(s)." << endl;
getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions