Javatpoint Logo
Javatpoint Logo

Java program to print the following pattern on the console

Java program to print the following pattern on the console

Algorithm:

  • STEP 1: START/li>
  • STEP 2: SET size=0./li>
  • STEP 3: DEFINE c./li>
  • STEP 4: PRINT new line./li>
  • STEP 5: SET size=5/li>
  • STEP 6: DEFINE i, j, k./li>
  • STEP 7: SET i = 0. REPEAT STEP 8 to STEP 14 UNTIL i< (size+1) /li>
  • STEP 8: SET j=size. REPEAT STEP 9 UNTIL j>i./li>
  • STEP 9: PRINT "" and SET j=j-1/li>
  • STEP 10: SET k=0. REPEAT STEP 11 and 12 UNTIL k<(2*i-1)/li>
  • STEP 11: PRINT * /li>
  • STEP 12: SET k=k+1/li>
  • STEP 13: PRINT new line./li>
  • STEP 14: SET i= i+1./li>
  • STEP 15: END

Program:

Output:

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




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA