You are on page 1of 1

//* program to find 1^2+2^2+...

+n^2*//

import java.io.*;

class sum

public static void main (String args[]) throws IOException

BufferedReader bufferstream=new BufferedReader(new


InputStreamReader(System.in));

int n,sum=0,i;

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

System.out.flush();

n=Integer.parseInt(bufferstream.readLine());

System.out.println("the sum of square of series is");

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

sum=sum+i*i;

System.out.println(sum);