Sum the Series
Write a C program to Calculate the below Series. The Value of x and n must take from input terminal. 1. Sum = x + x 2 + x 3 +…. + x n 2. Sum = x + 2x + 3x +…. + nx 3. Sum=x 1 + x 1/2 + x 1/3 + …. + x 1/n 1. #include main() { int x, n, I, sum=0, y; scanf("%d %d", &x, &n); y=x; for(I=1;I<=n;I++) { if(I==1) { printf("\n%d+", x); } else if(I==n) { printf("%d^%d = ", x, n); } else { printf("%d^%d+", x, I); } sum+=y; y=y*x; } printf("%d", sum); getch(); return 0; } 2. #include main() { int x, n, I, sum=0; scanf("%d %d", &x, &n); for(I=1;I<=n;I++) { if(I==1) { printf("\n%d+", x); } else if(I==n) { printf("%dx%d = ", n, x); } else { printf(&q