Created
July 21, 2016 00:17
-
-
Save antonio-abrantes/b39998a8806d51726aef1fcbceba902e to your computer and use it in GitHub Desktop.
Soma de Divisores
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int n, i; | |
scanf("%d",&n); | |
int soma = 0; | |
for(i = 1;i <= (n/2); i++){ //Calcular a soma dos divisores sem incluir o numero de entrada... | |
if(n % i == 0){ | |
soma = soma + i; | |
} | |
} | |
printf("A soma e: %d \n",soma); | |
system("PAUSE"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment