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
printing numbers without using loop
Exploiting uninitialized variable
Multiples of 10 sum
FloatInt
pseudo hw
Pozdravljeni v mali soli C.
Lab 9 v0.9
141124_PI
bit wise operation
Quiz4