By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

C++ program to print how many positive numbers are entered, how many negative numbers

P: 1
Write a program that asks the user to enter 10 integers.
The program should print how many positive numbers are
entered, how many negative numbers are entered and how
many zeros are entered.
how do I solve this using do or while or for statements ? :/
Jul 19 '16 #1
Share this Question
Share on Google+
2 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
Do this by degrees.

First, in your main() write a loop that cycles 10 times.

Get this working then post again.
Jul 20 '16 #2

Expert 100+
P: 2,400
What do you want your program to do if the user enters something invalid?
There are two kinds of invalid: nothing about the input looks like an integer; and the input is an integer that is followed by non-integer characters.
Jul 21 '16 #3

Post your reply

Sign in to post your reply or Sign up for a free account.