Home » Java program to print the following pattern on the console 5

Java program to print the following pattern on the console 5

by Online Tutorials Library

Java program to print the following pattern on the console

Java program to print the following pattern on the console

Algorithm:

  • STEP 1: START
  • STEP 2: SET i =1.REPEAT STEP 3 to 7UNTIL i<=10.
  • STEP 3: SET j=1.REPEAT STEP 4 and 5UNTIL j<=10.
  • STEP 4: if(i==0 or i==10 or j==0 or j==10) then PRINT 1 else PRINT “”
  • STEP 5: SET j=j+1
  • STEP 6: PRINT new line.
  • STEP 7: SET i=i+1
  • STEP 8: END

Program:

Output:

Java program to print the following pattern on the console

Next TopicJava Programs

You may also like