Skip to content

Instantly share code, notes, and snippets.

@fernandoguedes
Last active December 15, 2015 15:29
Show Gist options
  • Save fernandoguedes/5281744 to your computer and use it in GitHub Desktop.
Save fernandoguedes/5281744 to your computer and use it in GitHub Desktop.
Trabalho Aline, exercicio 01 (em C).
#include <stdlib.h>
#include <stdio.h>
main() {
int n[8], i, soma, cont;
soma = 0;
cont = 0;
for(i = 1; i <= 8; i++) {
printf("Informe um numero: \n");
scanf("%d", &n[i]);
if (n[i] > 30) {
soma = soma + n[i];
cont++;
}
}
printf("%d numeros são maiores que 30.\nA soma deles é igual a %d\n", cont, soma);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment