#include <stdio.h>
#include <locale.h>
int main () {
setlocale (LC_ALL,"Portuguese"); // Formatação.
int notas1[50],notas2[50],notas3[50],soma[50]; // Declaração.
for (int i = 1; i < 50; i++){ // Dados.
printf("\nInforme a primeira nota do aluno %i: ",i);
scanf("%i",¬as1[i]);
printf("\nInforme a segunda nota do aluno %i: ",i);
scanf("%i",¬as2[i]);
printf("\nInforme a terceira nota do aluno %i: ",i);
scanf("%i",¬as3[i]); }
for (int h = 1; h < 50; h++){ // Soma e divisão dos vetores 1,2 e 3 para cada nota.
soma[h] = (notas1[h] + notas2 [h] + notas3 [h])/3; }
for (int j = 1; j < 50; j++){ // Imprimindo.
printf ("\nA nota do aluno %i é: %i",j,soma[j]); }
return 0;
}
My doubts are: How would I ask for the number of vectors to be created for the user and then save in the variable to continue the program (without doing with pointer)? How would the extremely simplified code look like, or better what would that code look like if it was done with a pointer (I tried but did not give it).