Create a program that asks the user to type 10 values, add these results and present them on the screen.
I've only been able to do with an integer array.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i, soma;
soma = 0;
int num[10];
printf("Digite 10 numeros para somar:\n");
for(i= 0; i<10; i++) {
printf("Digite a %d nota: ", i+1);
scanf("%d", &num[i]);
soma +=num[i];
}
printf("\nSoma = %d : ", soma);
system("pause");
return 0;
}
How do I add the 10 values read without using array ???