Advertisement
Guest User

Untitled

a guest
Feb 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3.  
  4. void main()
  5. {
  6.     int i;
  7.     int s,t;//series,terms
  8.     int sum=0;
  9.  
  10.     printf("Input the number of series: ");
  11.     scanf("%d",&s);
  12.     printf("Input the number of terms: ");
  13.     scanf("%d",&t);
  14.  
  15.  
  16.     for(i=1;i<=t;i++)
  17.     {
  18.         printf("%d + ",(pow(10,i)*s)/9);
  19.     }
  20.     printf("\n");
  21.  
  22.     for(i=1;i<=t;i++)
  23.     {
  24.         sum += (pow(10,i)*s)/9;
  25.     }
  26.     printf("The Result is: %d",sum);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement