Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Question18 {
- public static void main(String[] args) {
- printDesign();
- }
- public static void printDesign() {
- for (int lines = 1; lines <= 5; lines++) {
- for (int dashes = 1; dashes <= lines * -1 + 6; dashes++) {
- System.out.print("-");
- }
- for (int numbers = 1; numbers <= lines * 2 - 1; numbers++) {
- System.out.print((lines * 2) - 1);
- }
- for (int dashes = 1; dashes <= lines * -1 + 6; dashes++) {
- System.out.print("-");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment