2
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i, notas[5];
int soma = 0;
for(i=0; i<3; i++) {
printf("Digite os tres numeros:\n");
scanf("%d", ¬as[i]);
}
for(i=0; i<3; i++) {
soma = soma + notas[i];
soma = notas[1] + notas [2] + notas[3];
printf("Valor: %d\n", soma);
}
return 0;
}
I don’t know why it doesn’t work, I wanted to read three numbers and display, plus the sum, but it doesn’t work, returns the size of the variable "sum".
If I want to display the read value in just one row, how do I do it? For example: insert 0 2 3, integers. already tried without the n ??
– Chhh
@Chhh you want to display the values informed by the user and then the sum of them?
– Luis Henrique
Yes, without typing "ENTER", insert the values with space.
– Chhh
@Chhh edited the answer to what you asked for.
– Luis Henrique
Thank you, just as I wanted :)
– Chhh