CJCoding With Joseph

Count Negative Numbers

The 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:

3

Print only the number followed by a newline.

Expected Output:

3
Topics:
Arrays
๐Ÿ“ฅ Auto-Input:
7\n4 -2 7 -8 -1 3 0\n
This input is automatically fed to your program's stdin
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.