class Harmonic

{

public static void main(String…s)

{

int n,i;

float sum=0;

n=Integer.parseInt(s[0]);

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

{

sum=sum+(float)1/i;

}

System.out.println(“nSum=”+sum);

}

}

class Harmonic

{

public static void main(String…s)

{

int n,i;

float sum=0;

n=Integer.parseInt(s[0]);

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

{

sum=sum+(float)1/i;

}

System.out.println(“nSum=”+sum);

}

}

class Harmonic

{

public static void main(String…s)

{

int n,i;

float sum=0;

n=Integer.parseInt(s[0]);

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

{

sum=sum+(float)1/i;

}

System.out.println(“nSum=”+sum);

}

}

Plz tell the code for harmonic series

S = 1-1/2 + 1/3 – 1/4…… -1/10

I want Harmonic series program for the below expression.

1/(n+1)+1/(n+2)+1/(n+3)+………1/(n+n);

please,help me for this.

still there no update for my request.please send the reply for the request

How to find the sum of series

Question:

1*1+ 2*2+3*3*3+4*4+5*5+6*6*6+……