Company: Cognitive_20nov
Difficulty: medium
Sum of Negative Numbers Problem Description You are given four integers a , b , c and d . Find the sum of the negative numbers among those four and return it. A number is negative when it is strictly less than 0 . Zero is not negative. If none of the four numbers is negative, return 0 . Complete the function sum_of_negative(a, b, c, d) , which returns that sum. Input Four integers, one per line: the first line is a , the second b , the third c and the fourth d . Output Print one integer: the sum of the negative values among a , b , c and d , or 0 if there are none. Constraints -500000000 <= a, b, c, d <= 500000000 With that bound the answer lies between -2000000000 and 0 , so it always fits in a signed 32-bit integer. Examples Example 1 Input: 2 -3 -14 7 Output: -17 Explanation: the negative numbers are -3 and -14 , and -3 + (-14) = -17 . The positive numbers 2 and 7 are ignored. Example 2 Input: -1 -10 2 -25 Output: -36 Explanation: the negative numbers are -1 , -10 and -25 , an