6 of 6
Paper No: 8
5
10 5 2 20 3
20
OUTPUT:
20 10 5 2
Press any key to continue
Question 8:
(1 mark, file to be edited: Q8.c)
Your program allows the user to enter an array of N integers, where N is entered by the user (STDIN).
Next, ask the user to enter a integer M.
Find and print all the elements of the array. For prime elements, print its power of M (prime numbers are numbers that have exactly two factors, 1 and itself).
Below is an example:
Enter N = 7; array = {2, -2, 8, 0, 7, 9, 20); M = 3
7
+ 100%
Zoom
Close