Computer Science, asked by harshallohokare, 1 year ago

java program to print series 1+4+9+............+400

Answers

Answered by amanpeekay0
10

PROGRAM :-


class Series

{

   void print()

   {

       System.out.println("Series:");

       for(int i = 1; i <= 20 ; i++)

       {

           System.out.print((int)(Math.pow(i,2))) ;

           if(i < 20)

           System.out.print(" + ") ;

       }

   }

}

Similar questions