-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
075d88e
commit be2c7ae
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Write a program to print letter Z exactly | ||
class Z{ | ||
public static void main(String args[]){ | ||
|
||
|
||
for(int x=0;x<8;x++){ //for iteration of lines from top to bottom | ||
for(int y=0;y<9;y++){ //for iteration of lines from left to right | ||
if(x==0 || x==7){ | ||
System.out.print("@"); //to print @ where necessary | ||
} | ||
else if(x+y==7 || x+y==8){ | ||
System.out.print("#"); //to print # where necessary | ||
} | ||
else{ | ||
System.out.print(" "); //to print spaces where necessary | ||
} | ||
} | ||
System.out.println(); | ||
} | ||
} | ||
} |