Press any кеу
Question 10:
(1 mark, file to be edited: Q10.c)
The program allows the user to enter an array of n integers from the keyboard.
Find and print the sum of the values of the perfect numbers in the input array. If there is no perfect number in the array, print the message: "There is no perfect number among the n elements of the array".
Knowing that a perfect number is a number whose sum of its divisors is equal to itself.
Below is an example:
Cas
e1
5
9 6 20 28 15
OUTPUT:
34
Press any key to continue
5
Cas e 2
5 7 2 10 4
OUTPUT:
There is no perfect number among the 5 elements of the array
Press any key to continue
Zoom
88%
Close