← Back to Arrays
Question 418
Count Negative Numbers
Count Negative Numbers
The program reads an integern, then readsnintegers into an array. Count how many of them are negative (less than0) and print that single count. For the input7followed by4 -2 7 -8 -1 3 0, print the output shown in Expected Output. Print only the number followed by a newline.
Expected Output:
3= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Arrays
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.