To Make Logic First We Think That We Have To Traverse Whole Array Form Start To End So we Decide To Use a Loop
First for Loop Taking Input in Array Element By Element Second Displaying Entered Elements
Third for Loop Which is Main For Loop Having an if Condition Which Checks Every Array Element with Key
What is a perfect number?
"Perfect number is a positive number which sum of all positive divisors excluding that number."
For example 6 is Perfect Number since divisor of 6 are 1, 2 and 3. Sum of its divisor is
1 + 2+ 3 =6
and 28 is also a Perfect Number
since 1+ 2 + 4 + 7 + 14= 28