[ create a new paste ] login | about

Link: http://codepad.org/NTbHi0Jh    [ raw code | output | fork ]

C, pasted on Dec 23:
#include <stdio.h>
#include <stdlib.h>

int fatorial (int num){
    
    if (num<=1)
    return 1;
    else
    return num *fatorial(num-1); 
}





int main (){
     
     int num;
     
     printf("Informe o numero ");
     scanf("%d", &num);
     
     printf("o fatorial de %d eh %d\n", num, fatorial(num));
     
     
system("pause");
     
     }


Output:
1
Disallowed system call: SYS_fork


Create a new paste based on this one


Comments: