Posts by pedroppimentel • 1 point
3 posts
-
0
votes3
answers459
viewsA: Store values in matrices
just reset the sum at the end of the second for loop: for (i=1; i<6; i++){ printf("\n Digite o nome do aluno: "); scanf("%s", &ficha[i].nome); printf("\n Nome: %s", ficha[i].nome); for (j=1;…
-
0
votes3
answers4140
viewsA: Function that calculates the factorial of a number
I found some errors in your code, follow the corrected code: int fatorial(int n){ int aux = n - 1; while(aux > 1){ n = n * aux; aux--; } return n; } int main(void){ int resultado; int n; int f;…
-
0
votes1
answer63
viewsA: Program in C compiles but shows error in Output
There were some errors in the code: 1 - first, the correct is "setlocale" not "setlocate" 2 - after scanf it is necessary to put "&" for the variables that will receive the entered value Follow…