Tuesday, December 30, 2014

BlueJ Program to print the series (1*2)+(2*3)+......+(19*20)


Here is the BlueJ program.




class S
{
  
   int i;
   long lg=0;
    public void show()
    {
        for(i=1;i< 20;i++)
        {
            lg=lg+(i*(i+1));
        }
        System.out.println("Series="+lg);
    }
        public static void main(String args[])
        {
             S ob=new S();
             ob.show();
            }

        }

Back To BlueJ Series Display Programs Home Page: CLICK HERE

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner