RahulShaw

Series No. 2

Mar 3rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.  
  5.     int n;
  6.     int product = 1;
  7.     printf("Enter the number of terms:\n");
  8.     scanf("%d", &n);
  9.     printf("Printing the %d terms\n", n);
  10.  
  11.     for(int i = 1; i <=n; i++) {
  12.         product = product * i;
  13.         printf("%d", product);
  14.         if(i < n) {
  15.             printf("%c", ',');
  16.         }
  17.     }
  18. }
Add Comment
Please, Sign In to add comment