36.4k views
1 vote
Write an algorithm using pseudocode to input numbers . reject any numbers that are negative and count how many numbers are positive . when the number zero is input the process ends and the count of positive numbers is output .​

1 Answer

2 votes

Answer:

Step-by-step explanation:

Let's use Python for this. We will start prompting the user for input number, until it get 0, count only if it's positive:

input_number = Input("Please input an integer")

positive_count = 0

while input_number != 0:

if input_number > 0:

positive_count += 1

input_number = Input("Please input an integer")

print(positive_count)

User Hasintha Janka
by
4.6k points