write a program in java to find the sum of the following series 2 ka square +4 ka square+6 ka square +.......n
Answers
Answered by
0
I will tell you the answer tomorrow pls don't delete it. it's late
ritwik46:
i dont know
Answered by
1
import java.io.*;
class squares
{
public static void main (String args [ ]) throws IOException
{
BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
System.out.println ("Enter the value of n");
int n= Integer.parseInt (br.readLine ());
double sq=0.0, sum=0.0;
for(int i=2;i <=n;i=i+2)
{
sq=Math.pow (i,2);
sum=sum+sq;
}
System.out.println ("The sum of the series is " +sum);
}
}
If you liked it please mark it as brainliest ans...
class squares
{
public static void main (String args [ ]) throws IOException
{
BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
System.out.println ("Enter the value of n");
int n= Integer.parseInt (br.readLine ());
double sq=0.0, sum=0.0;
for(int i=2;i <=n;i=i+2)
{
sq=Math.pow (i,2);
sum=sum+sq;
}
System.out.println ("The sum of the series is " +sum);
}
}
If you liked it please mark it as brainliest ans...
Similar questions
Physics,
7 months ago
Math,
7 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago
English,
1 year ago