0
Write a c++ program to count the numbers of adult persons and non adult persons,while we have 18 people..create 2 counters
one for adult one for non adult
4 Antworten
+ 7
How are the adults and non-adults determined? In a pre-defined array? User input?
+ 5
Have you even tried making a program for this?
Yes - Show us where you face a problem and we will help you then by solving the problem and then providing you suggestions where you can optimise your code for better results and wider input handling...
No - Why not? How will you develop then? Try making something and we'll help you if something works incorrectly or help you improve your code. This way, you'll be a better programmer than before. Please note that this section is for help,suggestions and improvements, not for posting homework...
If you disagree, let me know, atleast by a dislike...
+ 3
For the adult part, you will need :
if(age>=18) adult++;
else non_adult++;
Put this in a do...while() loop to continue reading and stop only when you are done...
The counters must be initialized to 0, so that you don't get gibberish.
+ 1
user input @hatsy rei