Program to display the following series.// -1 2-3 4.......n

class math
{
public void series(int n)
{
double a,b,c;
System.out.println(“The required series is “);
for(int i=1;i<=n;i++)
{
b=Math.pow(-1,i);
System.out.println(i*b);
}
}
}