Computer Science, asked by lalitamrj25, 8 months ago

write a program in java to find the sum of the given series:
a) s= a2+a2/2+a2/3+....... +a2/10

Answers

Answered by shyammodi1729
22

Answer:

Hope it helps plz like my answer and plz mark me as Brainliest

Explanation:

# a Java program

import java.util.*;

class Sum_series

{

public static void main (String args[])

{

Scanner sc=new Scanner (System.in());

double sum=0;

System.out.println("enter the value of n");

int n=sc.nextInt();

System.out.println("enter "+n+" numbers");

for(int i=1;i<=n;i ++)

{

a=sc.nextInt();

sum=sum+1.0/a;

}

System.out.println("sum of series="+sum);

}

}

Answered by ganapa9987
1

Answer:

Mark as Brainlist answer Pls

Attachments:
Similar questions