Email: Password:       Forgot Password 
    .netCodeSG
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.
 
TECHNOLOGIES:
 

series

Article:
Viewed:  925 
Posted On:  23/07/2013 22:29:11 
Hi all,With the help of this article i am going to tell you that how we can print the series 1,4,9,16,25,..............up to 15 terms 

 

Below is my code:


class series
{
public static void main(String s[])
{
int a,b;
for(a=1;a<=15;a++)
{
b=a*a;
System.out.print(","+b);
}
}
}

       Step 1:  After writing this in notepad save the file with the name followed by (.java) for eg. I saved it with series.java

Step 2 :
 
Open command prompt 

Step 3 : 
Write javac series.java - Press Enter for compilation

Step 4 : 
Write java series for execution

Now output:

Series.png

Image 1.

  Comment:
         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us