Guest User

Untitled

a guest
Oct 24th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. unsigned long fact (unsigned long i) {
  4. if (i == 1 || i == 0) {
  5. return 1;
  6. } else {
  7. return fact(i - 1) * i;
  8. }
  9. }
  10.  
  11. int main() {
  12. int val = 8;
  13. printf("Factorial of %ul is %ul", val, fact(val));
  14. }
Advertisement
Add Comment
Please, Sign In to add comment