+ 2

java

CAN ANY ONE TELL ME HOW TO PRINT THIS OUTPUT IN HORIZONTAL FORM? public class MyClass { public static void main(String args[]) { int n=9; for (int i=0;i<n;i++) { for (int j=0;j<n;j++) { if(i==0 || j==0 || j==n-1&&i<n/2||i==n/2||i==j&&i+j>n-1) System.out.print(" * "); else System.out.print(" "); } System.out.println(" "); } System.out.println( ); for (int i=0;i<n;i++) { for (int j=0;j<n;j++) { if(i==0 || j==0 || j==n-1&&i<n/2||i==n/2||i==j&&i+j>n-1) System.out.print(" * "); else System.out.print(" "); } System.out.println(" "); } } }

29th Mar 2018, 5:36 PM
Ameer Basha
Ameer Basha - avatar
5 Answers
+ 2
its java
31st Mar 2018, 2:00 AM
Ameer Basha
Ameer Basha - avatar
+ 2
I currently am learning Javascript, so I wouldn't know anyway. (I also am learning html)
31st Mar 2018, 2:02 AM
Riley Myers
Riley Myers - avatar
+ 1
Java or Javascript? (I won't be able to answer your question though)
31st Mar 2018, 1:59 AM
Riley Myers
Riley Myers - avatar
0
its ok tq fr ur response👍
31st Mar 2018, 2:03 AM
Ameer Basha
Ameer Basha - avatar
0
I understand some acronyms (like lol) but I don't know those.
31st Mar 2018, 2:07 AM
Riley Myers
Riley Myers - avatar