Computer Science, asked by ritwik46, 1 year ago

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 M3CH4
0
I will tell you the answer tomorrow pls don't delete it. it's late

ritwik46: i dont know
M3CH4: maybe because you have marked him brainliest
ritwik46: oh
M3CH4: so do you really want that in simple form yes or not
ritwik46: yes
M3CH4: i can write it in the comment
M3CH4: ok
ritwik46: ok
M3CH4: tum compiter science ke question mein aadhe ghante mein ek 5 points ka same question pucho
ritwik46: ok
Answered by SouptikDasgupta
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...
Similar questions