Search
 
SCRIPT & CODE EXAMPLE
 

C

perfect numbers in c

/* C Program to find Perfect Number using For Loop */

# include <stdio.h>   

int main()   
{   
 int i, Number, Sum = 0 ;   
  
 printf("
 Please Enter any number 
") ;   
 scanf("%d", &Number) ;   
 
 for(i = 1 ; i < Number ; i++)   
  {   
   if(Number % i == 0)   
     Sum = Sum + i ;   
  }    

 if (Sum == Number)   
    printf("
 %d is a Perfect Number", Number) ;   
 else   
    printf("
%d is not the Perfect Number", Number) ;   

return 0 ;   
}
Comment

PREVIOUS NEXT
Code Example
C :: C do...while loop 
C :: Typecast Operator in C language 
C :: how to declare a structure in c 
C :: youtube code 
C :: matrix of string in c 
C :: fibonacchi series in c 
C :: calendar in c 
C :: open cv 
Dart :: how to diable flutter for web 
Dart :: flutter validate email 
Dart :: flutter generate random color 
Dart :: materialstateproperty color 
Dart :: how to give shape to card in flutter 
Dart :: card border radius in flutter 
Dart :: color of status bar flutter 
Dart :: options = null firebaseoptions cannot be null when creating the default app. flutter 
Dart :: dart switch 
Dart :: how to get screen size in flutter 
Dart :: dart loop through array 
Dart :: flutter listtile color 
Dart :: dart map foreach 
Dart :: list of strings in dart 
Dart :: remove duplicates from array dart 
Dart :: dart read file 
Dart :: dart empty check 
Dart :: flutter add value to list<map<string, int 
Dart :: flutter check type of object 
Dart :: children vs child dart 
Dart :: dart concat string and int 
Dart :: fix portrait oreintation flutter 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =