mujeres solteras 18 Square frame pattern is designed in accordance to the number of rows user has entered.

follow site In this java program, the user is asked to enter number of rows. It displays a hallow square based on number of rows.

Algorithm:

como conocer chicos en barcelona Step 1: Start.

http://energocredit.am/sdsd/9449 Step 2: Read number of rows to be printed. Store it in some variable, say n.

site de rencontre musulmans convertis Step 3: To iterate through rows, run an outer loop from 1 to n. For that define a for loop.

http://www.fordbaris.com/?jiiias=5-mm-forex-fiyat%C4%B1&702=6a Step 4: To iterate through columns, run an inner loop from 1 to n. Define a for loop.

operare in borsa on line Step 5: Inside inner loop print star for the first and last rows and first and last column. Otherwise enter space.

click Step 6: Stop.

Source code:

enter site

http://metodosalargarpene.es/ebioer/275

Explanation:

for(int i=1;i<=rows;i++) – To iterate through rows run an outer loop from 1 to rows.

clomid online purchase for(int j=1;j<=rows;j++) – To iterate through columns, run an inner loop from 1 to rows.

quitting dilantin 100mg if(i==1 || i==rows || j==1 || j==rows) – Inside inner loop print star for first and last row or for first and last column.

voveran 50 mg ge else print space.

Output:

C:\Users\santo\Desktop\new>javac Square.java

C:\Users\santo\Desktop\new>java Square

*** www.programmingposts.com ***

<< JAVA Program to print hallow square pattern >>

Enter number of rows:
6

*  *   *   *   *   *
*                  *
*                  *
*                  *
*                  *
*  *   *   *   *   *

Screenshot of Output:

Screenshot of Output

Leave a Reply

Your email address will not be published. Required fields are marked *