Count Negative Numbers
easyQuestion 418The program reads an integer n, then reads n integers into an array. Count how many of them are negative (less than 0) and print that single count.
For the input 7 followed by 4 -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, so 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.