Copy the skeleton of code below into your answer. Then in the space indicated, add your own code to prompt the user for a number. If the number is greater than 0 it should print a triangle of that size as shown below. If the number is less than or equal to 0 it should print nothing. See the transcripts below for some sample runs of this code:
Enter a number: 3******
A second run of this program with different input might look like this:
Enter a number: 5***************
A third run of this program with a zero or negative input might look like this:
Enter a number: -12
Use the skeleton of the main method below to write your code.
public static void main(String[] args) {Scanner input = new Scanner(System.in);// TODO: Your code below this lineinput.close();}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here