Multiply Negative numbers in java

For this challenge, you will be given an array and you are asked to count how many numbers are negative and multiply them and print the output to the STDOUT. 


Input Format - 
you will be taking a number as an input from STDIN which tells about the length of the array. On another line, array elements should be there with single space between them. 

Output Format 
print the multiplication to the STDOUT. 


Sample Test Case: 
Sample Input:-7
-8 -7 6 0 7 -1 6

Sample Output 
-56 

Explanation: 
There are three negative numbers present in the array and their multiplication comes out to be -56.

Comments

Post a Comment

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Profit and Loss