I am writing the book 6º edition of C as a program of the Deitel brothers and I am in doubt in an exercise, the exercise is 4.14 of chapter 4 that is about factorization, it asks a program that the user type a number and that number is factored, for example if the user types the number 5, the program will make 5 * 4 * 3 * 2 * 1 resulting in 120. If someone can give me some hint and no answer I will be very grateful thank you:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i, num, aux1=0, fat=0, aux=0;
printf("digite um numero para ser fatorado:\n");
scanf("%i", &num);
printf("\nvamos fatorar entao o numero %i:\n\n", num);
for(i=num;i>=1;i--)
{
aux=i;
fat=aux*i;
printf("%i! ", fat);
}
return 0;
}