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();
}
No comments:
Post a Comment