I want to get this output via loops. However user needs to define the value when it runs. So, when the user inputs 6, the result should be this(notice 6 rows are created! with incrementing spaces between the characters):
##
# #
# #
# #
# #
# #
I have wrote the code so far and am really confused as to how to add spaces.. The code so far looks like this :
import java.util.*;
public class Pattern {
public static void main(String[] args)
{
int input;
Scanner kb = new Scanner(System.in);
System.out.print("Enter a positive number: ");
input = kb.nextInt();
while (input <= 0)
{
System.out.print("That isn't positive, try again: ");
input= kb.nextInt();
}
for (int number = 0; number < input; number++)
{
System.out.print("#");