sexta-feira, 10 de dezembro de 2010

on
#include<stdio.h>
#include<stdlib.h>
int fatorial(int fator){
    if(fator<=1){
             return (1);
             }
    else{
     return fator*fatorial(fator-1);
     }
     }
main(){
       int resultado,num;
       printf("Digite um numero:\n>>> ");
       scanf("%d",&num);
       resultado=fatorial(num);
       printf("o fatorial de %d eh %d\n",num,resultado);
       system("pause");
       return (0);
       }

Espero ter ajudado e até a próxima....

0 comentários:

Postar um comentário

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.