Problem with creating a triangle out of integers...
So the program compiles and runs fine, but I'm stuck on figuring out the command/code to print the triangle using the 2nd digit of a two-digit number.
For example, if the user enters 12, the program currently shows
and so forth.
Where I would want it to use the 2nd digit only, showing
2222. etc etc etc.
Any guidance would be greatly appreciated!
public class TriangleOfDigits
public static void main(String a)
Scanner kbd = new Scanner(System.in);
System.out.println("Enter an integer from 1 to 12:");
int b = kbd.nextInt();
for(j=0; j<=b; j++)
for(i=0; i<=j; i++)
for (j=b-1; j>=0; j--)
for (i = j-1; i>=0; i--)
Re: Problem with creating a triangle out of integers...