Write a program in java to find the sum of the given series: 1/2 + 2/3 + 3/4 + ⋯ + 49/50
Answers
Answered by
2
Answer:
Mark me as brainliest
Explanation:
import java.util.Scanner; public class KboatSeries { public static void main(String args[]) { Scanner in = new Scanner(System.in); System.out.print("Enter x: "); int x = in.nextInt(); double sum = 0.0; for (int i = 2; i <= 20; i = i+3) sum += (double)x / i; System.out.println("Sum = " + sum); }
Similar questions
Biology,
23 hours ago
India Languages,
23 hours ago
Hindi,
23 hours ago
Psychology,
1 day ago
Math,
8 months ago