Question about this!

Pages: 12
LB and OuIJ can you explain to me or show me how can to combine the number? Like for example, there are 3 positive # and the outcome is 3?
Look on lines 36 to 40. Unfortunately OUIJ accidentally wrote >= instead of >, so 0 gets counted as a positive number even though it is not, but you should see the general idea.
LB I see that and I fix it
huh? How do you count all the positive number? Like speaking, we have 3 positive number? OUIJ show me one by one but I want them to count all together? It is possible to that?
Yes. Just use one variable to keep count of all the positive numbers, and another to keep count of the negative ones.
1
2
3
4
5
if (findNum[i] >= 0)
        {
            int result = i + 1;
            cout <<"The positive is " << result << endl;
        }


when i do this it show me the
positive is ...
positive is ...
positive is ...
positive is ...
positive is ...
...
...

until 10.

how to do to where it only show one
What data are you inputting when you get this?
number
The thing I am trying to do is: For example, you enter 5 positive and 5 negative number. My problem should display The positive you have enter are "5" and the negative ...... are "5". but it wont show me that but it show me
the positive is ...
positive is ...
positive is ...
positive is ...
positive is ...
...
...

until 10
Well, yes. I presume you can see why the code you've written is doing that?

At risk of repeating myself:

Just use one variable to keep count of all the positive numbers, and another to keep count of the negative ones.
Yes...
Is there a reason you're editing your previous posts to remove their content, Chubby? Do you expect people to help you if you're going to remove all context of that help for anyone else who may have a similar issue and happen upon the thread?
Topic archived. No new replies allowed.
Pages: 12