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 size=6.
  • STEP 3: SET i=size. REEPAT STEP 4 to STEP 9 UNTIL i!=0
  • STEP 4: SET j=0.REPEAT STEP 5 UNTIL j<(size-i).
  • STEP 5: PRINT "" and SET j=j+1
  • STEP 6: SET k = 0. REPEAT STEP 7 UNTIL k<(2*i-1)
  • STEP 7: PRINT * and SET k=k+1
  • STEP 8: PRINT new line.
  • STEP 9: SET i=i-1.
  • STEP 10: END

Program:

Output:

Java program to print the following pattern on the console
Next TopicJava Programs




Latest Courses