Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_141110_Perfecto
//Title of this code #include <stdio.h> int main(void) { short N; short d; short suma; printf("Valor de N ... "); scanf(" %hd", &N); for(d = 1 , suma = 0 ; d <= N / 2 ; d++) { if(N % d == 0) { suma += d; } } // d = 1; // suma = 0; // while(d <= N / 2) // { // if(N % d == 0) { suma += d; } // d++; // } printf("\n\nLa suma es: %hd\n\n", suma); if(suma == N) { printf("SI PERFECTO!!\n\n"); } else { printf("NO PERFECTO!!\n\n"); } return 0; }
run
|
edit
|
history
|
help
0
Array Incrementing by 1
20171127_ARRAY_ValorMayor
Max successs
sreesasu
Dangling
fibonacci
a3
primeno
Assignment 8
A_141107_Potencia