Question: 1. (a) Write an algorithm called IsAFactor which takes as input two positive integers k and n and determines if k is a factor of
1. (a) Write an algorithm called IsAFactor which takes as input two positive integers k and n and determines if k is a factor of n, whenever k < n.
(b) Write a function PosNegSum which takes in an integer array of size n as a parameter and does the following:
(i) Prints the number of positive elements, negative elements and the elements equal to zero in the array
(ii) Prints the sum of the elements in the array
(iii) The function does not return any values
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
