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:
 

print the deign of right anle triangle of numbers

Article:
Viewed:  940 
Posted On:  23/07/2013 12:31:28 
In this Article i am going to print the deign of right anle triangle of numbersin java using nested loop........... 

 

Below is my code:

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


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

      Step 2
Open command prompt 

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

    
Step 4 : 
Write java fibonacci for execution

 Output:

Triangle Design.png 

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