#include <stdio.h>

int main() {
    int a, b, c =1, ver=0;
    do
    {
    printf("\nDigite o numero entre 0 e 16: \n");
    scanf("%i", &a);
    
    if(a > 16 || a <= 0)
    {
    	printf("\nErro: O numero deve ser entre 0 e 16\n");
    	ver=1;
	}
	else
	{
		ver=0;
	}
    }
    while(ver == 1);
    
    for(b = a; b > 1; b--)
	{
    c *= b;
    }
    printf("O fatorial de %i e: %i", a, c);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: