All pastes #277900 Raw Edit

smyows

public c v1 · immutable
·published 2006-12-13 17:49 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>int main(int argc, char *argv[]){        if(argc < 2)        {                printf("Usage: %s number\n", argv[0]);                return(0);        }        int fatorial(int n)        {                if(n == 0)                {                        printf("resultado de fatorial de %s é: 1\n%d\n", argv[1], n);                        return(0);                }                return(n*fatorial(n-1));        }        fatorial(atoi(argv[1]));        return(0);}