Skip to content

Commit e44526c

Browse files
committed
ucer 4B4 codes
1 parent 5c0a80c commit e44526c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

ucer/4B4/Pattern1.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* Program to print the following pattern
2+
*
3+
* *
4+
* * *
5+
* * * *
6+
*/
7+
8+
import java.util.Scanner;
9+
public class Pattern1{
10+
public static void main(String args[])
11+
{
12+
System.out.print("How many line you want to display: ");
13+
Scanner reader = new Scanner(System.in);
14+
int nl = reader.nextInt();
15+
for(int i= 0; i < nl; i++)
16+
{
17+
for(int j= 0; j <= i; j++)
18+
{
19+
System.out.print("*\t");
20+
}
21+
System.out.print("\n");
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)