0
Help me ....what i should change in this program
public static void main (string [] args) { for(int i=1;i<=5;i++) { for(int j=1;j<=5;j++) system.out.println("*"); } system.out.println(); } } I expect output ***** ***** ***** ***** ***** but output come * * * * *
1 Answer
+ 1
Change the System.out.println("*"); to System.out.print("*"); because "println" prints a new star each time the for loop loops while "print" prints 5 stars in one line