pranjal1805

Q1

May 15th, 2021 (edited)
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. int factorial(int x);
  3.  
  4. int main()
  5. {  
  6.     int a;
  7.     printf("bhai factorial ke liye number de de plis. UwU \n");
  8.     scanf("%d",&a);
  9.     printf("ye le bhai tera factorial ab maze kar: %d\n", factorial(a));
  10.    
  11.     return 0;
  12. }
  13.  
  14. int factorial(int x)
  15. {   int k=1;
  16.     for(int i=1;i<=x;i++){k=k*i;}
  17.     return k;
  18. }
  19.  
Add Comment
Please, Sign In to add comment