Question: The code must be written in C. Write a program that computes the number of elements in an array divisible by a user specified number.

The code must be written in C.
Write a program that computes the number of elements in an array divisible by a user specified number. Declare an integer array of size 7 and read the array elements from the user. Then, read a number k from the user and compute the number of elements in the array divisible by k. Consider the following example. 3 elements in this array are divisible by 2 ({2, 2, 4}). Sample execution of the program for this array is given below Enter 7 numbers 1 2 2 3 4 3 1 Enter k 2 3 elements are divisible by 2 Write and implement the following functions in your program: int divisible (int a, int b) int count (int data [], int n, int k) The function divisible returns 1 if a is divisible by b and 0 otherwise. The function count returns the number of elements divisible by k in array data. Use the function divisible in function count
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
