Computer Science, asked by dbpatel1903, 1 day ago

Write a program in java to find the sum of the given series: 1/2 + 2/3 + 3/4 + ⋯ + 49/50

Answers

Answered by mallepuramadevi
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