Thanks, I will aware of the variables used next time :rolleyes:
Type: Posts; User: John Joe
Thanks, I will aware of the variables used next time :rolleyes:
I think you mean this ?
public class Example {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Key in the row you want it to display:...
Don't understand :)] Did you mean it would be better if I assign a variable to 4 and 5 ?
This is the output
*
* *
* * *
* *
*
What did you mean "magic numbers" ?
Thanks for your reply Norm, I actually want it to print a diamond.
I have solved it.
for (int i = 1; i < 5; i += 2) {
for (int j = 0; j < 4 - i / 2; j++)
System.out.print(" ");...
Current output is
*
***
*****
*******
*********
Used nested loops that display following patterns
*
***
*****
***
*
I only able to have this, after that...