Hey Guys,
Today we discussed about For Loop Pattern Program in Java.
First pattern program.
Example1 ↬ Pattern 1.
class Main
{
public static void main (String[] args)
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print("*");
}
System.out.println();
}
}
}
Output :-
* ** *** **** *****
0 Comments
Post a Comment