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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!