Perfect Number Program in C

Valentsea
Total
0
Shares

For explanation watch video

Perfect Number :
In mathematics, a perfect number is a positive
integer that is equal to the sum of its positive divisors, excluding the number itself.
ex : 6 = 1,2,3 < 6

1+2+3 =6
ex: 5 : 1
sum = 1 !=5
5 is not perfect number
Perfect Numbers examples : 6,28,496,8128

Program to check given number is perfect or not:

#include
int main(){
    int n;
    printf("Enter the number: ");
    scanf("%d",&n);
    int sum = 0,i;
    for(i=1;i
Enter fullscreen mode

Exit fullscreen mode

Total
0
Shares
Valentsea

Introduction to JavaScript | JavaScript Introduction Tutorial in Hindi (CC)

Introduction to JavaScript | JavaScript Introduction Tutorial in Hindi learn coding. #java #javascript #javascriptforbeginners #computergyanguruji Our second channel…

You May Also Like