Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include<stdio.h>
  2. int fatorial(int *n){
  3. if ((*n==1) || (*n==0)) return 1;
  4. else return fatorial(*n-1)*n;
  5. }
  6. int main(){
  7. int n = 5;
  8. printf("%dn",fatorial (&n));
  9. }
  10.  
  11. else return fatorial(*n-1)*n;
  12.  
  13. [Warning] passing argument 1 of 'fatorial' makes pointer from integer without a cast
  14. [Note] expected 'int *' but argument is of type 'int'
  15. [Error] invalid operands to binary * (have 'int' and 'int *')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement