Write a code to display the following pattern.
# # # # # # #
# #
# #
# #
# #
# # # # # # #
# # # # # # #
# #
# #
# #
# #
# # # # # # #
public class Pattern2{ public static void main(String [] args) { for(int i=1;i<=6;i++) { if(i==1||i==6) System.out.println("#######"); else System.out.println("# #"); } } }
No comments:
Post a Comment