any ney
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 number of 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
e 1
5
9 6 20 28 15
OUTPUT:
2
Press any key to continue
5
9 5 30 27 15
OUTPUT:
There is no perfect number among the 5 elements of the array
Press any key to continue
Cas
e 2
Zoom
+ 100%
Close