Posts

Showing posts from September 18, 2021

Functions in C Problem 1

Image
 Functions in C Problem 1 PROBLEM STATEMENT : The function/method getProductSign accepts two arguments - SIZE and arr . The integer SIZE represents the size of the integer array arr.  The function/method getProductSign must return the sign of the product of all the integers in the given array.  - If the product is a positive value, then the function must return 1 .  - If the product is a negative value, then the function must return -1 .  - If the product is 0 , then the function must return 0.  Your task is to implement the function getProductSign so that the program runs successfully. Boundary Condition(s):  1 <= N <= 1000  -100 <= Each integer value <= 100  Example Input/Output 1: Input: 4 -1 2 3 -4 Output: 1 Explanation: The product of the given four integers is 24 (-1 * 2 * 3 * -4). Here 24 is a positive value, so 1 is printed. Example Input/Output 2: Input: 5 10 20 -30 4 5 Output: -1 Example Input/Output 3: Input: 3 -6 0 -5 ...