The given Q1.c file already contains statements to enter data for the variable n. You write the statements check whether n is a perfect number or not (a perfect number is a number that has the sum of its divisors equal to itself). If true then return 1, otherwise return 0.
Notes:
- You can create new function(s) if you see it is necessary.
- Do not edit given statements in the main function.
2 of 3 Paper No: 1
Sample input and output:
-Input: n = 5
Output for marking:
OUTPUT:0
-Input: n = 6
Output for marking:
OUTPUT:
1
Zoom
+ 88%
Close