Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Chapter 2 Question 2
- *
- * Zain Arfi
- * @version (a version number or a date)
- */
- public class TestQ2
- {
- public static final int size=10;
- public static void main(String[] args)
- {
- for(int row=1; row<=5; row++)
- {
- for(int dashes=1; dashes<=row*-1+size+1; dashes++)
- {
- System.out.print("-");
- }
- for(int numb=1; numb<=row*2-1; numb++)
- {
- System.out.print(2*row-1);
- }
- for(int dashes=1; dashes<=row*-1+size+1; dashes++)
- {
- System.out.print("-");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement