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