0
#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 code look extremely simplified or better like this code only done with pointer ( I tried but I didn’t notice ).
If the answer solved your problem, you can click on V next to the answer to mark your question as answered.
– Brumazzi DB
I’ve already scored vlw.
– user48471