1
Can anyone help me with the logic of this code? the beginning of it I understand but I get a little confused in the part of the for, someone can help me to understand ?
#include <stdio.h>
int main(){
int fatorial, n;
printf("insira o numero que vc quer fatorar\n");
scanf("%i",&n);
for(fatorial=1;n>=1; n--){
fatorial *= n;
}
printf("o fator do seu numero e: %i",fatorial);
return 0;
}
You tested this code?
– Leandro Kojima
yes yes tested.
– João Vitor Camargo de Alemida