Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include<stdio.h>
  2. int fact(int n)
  3. {
  4. int i,b=1;
  5. for(i=1;i<=n;i++){
  6. b*=i;
  7. }
  8. return b;
  9.  
  10. }
  11. int main()
  12. {
  13.  
  14. int sum;
  15. sum=fact(1)/1+fact(2)/2+fact(3)/3+fact(4)/4+fact(5)/5;
  16. printf("The sum of the series is:%d\n\n",sum);
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement