fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main() {
  4. double x, z, res, x2, x3, z2, x4, z3, x5, z4;
  5. printf("Enter x = ");
  6. scanf("%lf", &x);
  7. printf("Enter z = ");
  8. scanf("%lf", &z);
  9. x2 = pow(x, 2);
  10. x3 = pow(x, 3);
  11. z2 = pow(z, 2);
  12. x4 = pow(x, 4);
  13. z3 = pow(z, 3);
  14. x5 = pow(x, 5);
  15. z4 = pow(z, 4);
  16. res =1 / x + 2 / x2 + z + 3 / x3 + z2 + 4 / x4 + z3 + 5 / x5 + z4;
  17. printf("Result = %If", res);
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5532KB
stdin
Standard input is empty
stdout
Enter x = Enter z = Result = inf