Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class P33 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- // using for loop to output 5 "*"
- // using for loop to output 1 space 3 "*" 1 space
- // using for loop to output 2 spaces 1 "*" 2 spaces
- // *****
- // ***
- // *
- for (int i=0; i<5; i++) {
- System.out.print("*");
- }
- System.out.println();
- System.out.print(" ");
- for (int i=0; i<3; i++) {
- System.out.print("*");
- }
- System.out.println(" ");
- for (int i=0; i<2; i++) {
- System.out.print(" ");
- }
- System.out.print("*");
- for (int i=0; i<2; i++) {
- System.out.print(" ");
- }
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement