#include <stdio.h> int main() { int soma = 0; printf("Digite 10 numeros para somar:\n"); for (int i = 0; i < 10; i++) { int num; printf("Digite a %d nota: ", i + 1); scanf("%d", &num); soma += num; } printf("\nSoma = %d : ", soma); } //https://pt.stackoverflow.com/q/76029/101
1 2 3 4 5
Digite 10 numeros para somar: Digite a 1 nota: Digite a 2 nota: Digite a 3 nota: Digite a 4 nota: Digite a 5 nota: Digite a 6 nota: Digite a 7 nota: Digite a 8 nota: Digite a 9 nota: Digite a 10 nota: Soma = 40 :
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!