InterviewSolution
Saved Bookmarks
| 1. |
Program to find sum of series 1 + 1/2 + 1/3 + 1/4 + .. + 1/n Please friends it's a humble requestDon't Give irrelevant answers otherwise Your answer will be directly reportedRadhe Radhe ❤️✌️ |
|
Answer» java.util.Scanner;public class SeriesSum { public static void main(String[ ] args) { System.out.print("Enter n - "); int n = NEW Scanner(System.in).nextInt( ); float sum = 0; for (int i = 1; i <= n; i++, sum += 1f / i); System.out.println("Sum of series - " + sum); }} |
|