
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Practice exercise on java coding
Typology: Exercises
1 / 1
This page cannot be seen from the preview
Don't miss anything!

The following is a function of some class. It returns 1 if the number is a perfect number otherwise it returns 0. /* A perfect number is a number which is equal to the sum of its factors other than the number itself */ int perfectNo(int n) { int ??1? for (int j = 1; ??2?; j++) { if (??3?) sum ??4?; } if (??5?) return 1; else return 0; } (i) What is the expression/value at ??1? (ii) What is the expression/value at ??2? (iii) What is the expression/value at ??3? (iv) What is the expression/value at ??4? (v) What is the expression/value at ??5?