Asked by
AL MaMun (4 Golds)
Friday, 31 Jul 2020, 04:53 PM
at (Education
Tutorials)
|
|
|
|
C program to check a perfect number : #include<stdio.h> int main() { int n, i=1, sum=0; scanf("%d", &n); for(i=1; i<n; i++) { if(n%i==0) sum=sum+i; } if(sum==n) printf("Perfect Number"); else printf("Not Perfect Number"); } |