InterviewSolution
Saved Bookmarks
| 1. |
Write a Java program to print the following pattern: * *# *#* *#*# *#*#* |
|
Answer» PUBLIC class pattern1 { { for(INT i=1; i<=5; i++) { for(int j=1; j<=i; j++) { if(i%2==0) System.out.print("#"); else System.out.print("*"); } System.out.println(); } } } |
|