techhipbettruvabetnorabahisbahis forumutaraftarium24eduedusedueduseduedusedueduseduedus 8 Star Pattern Java Program - 4 Ways | Programs
Latest :

8 Star Pattern Java Program – 4 Ways | Programs

Java program to print 8-star pattern program. We have written below the print/draw 8-star asterisk/star pattern program in four different ways with sample example and output, check it out. At the end of the program, we have added compiler so that you can execute the below codes.

Using For Loop

1) First, checks the condition at for loop, if it is true, then it comes to”if “condition.

If the “if” condition is true then run the first inner for loop, otherwise, run the 2nd inner for loop.

2) In the first inner loop iterates from j=1 to j=n, checks the “if “condition, if it is true it will display “space'” otherwise it comes to else part and display the “*” symbol.

3) If the first “if” condition is false then 2nd inner for loop will be executed, in the 2nd for loop iterates from j=1 to j=n, check the “if” condition if it true it displays the “*” symbol otherwise it displays “space”.

Output:

Using While Loop

1) First, the condition at while will be checked, if the condition is true it checks the “if” condition if it true it executes the first inner while loop otherwise it comes to the else part i.e 2nd inner while loop.

2) In the 1st inner while loop, if the condition at while is true then checks the “if ” condition, if the condition is true then it displays “space” otherwise it displays “*”, it will continue until the inner while loop condition is false.

3) 2nd inner while loop executes only the if condition at outer while loop is false, in 2nd inner while loop first checks the condition at while will be checked after that checks the “if” condition, if condition true then displays “*” otherwise displays “space”.

4) The total code in the outer while loop will execute until the condition at while is false.

Output:

Using Do-While Loop

1) If the condition at the “if” is true in an outer do-while loop it executes the 1st inner do-while loop, otherwise it comes to else part i.e. 2nd inner do-while loop.

2) In 1st inner do-while loop if the “if” condition is true it will display space otherwise it will display “*”, 2nd inner do-while loop if the “if” condition is true then it will display “*” otherwise it will display space.

3) The total code in the outer do-while loop will be executed until the while condition is false i.e while(i<=k).

Output:

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduedusedueduseduseduseduseduedus
x

Check Also

Java Program To Reverse An Array | Programs

Java program to reverse an array – We will discuss the various methods to reverse ...

grandpashabetgrandpashabetgrandpashabethttps://mobilebarhawaii.com/ballettea tropazcasibom girişcasibomhacklinkgrandpashabetbets10onwinonwin girişgrandpashabetholiganbetatakoy escortatakoy escortsisli escortjojobetCasibomtürk pornomavibet girişcratosroyalbetdeneme bonusu veren sitelergrandpashabetonwinligobetgonabetJojobetsahabethttps://www.escortbayanlariz.net/betwoonsahabetcasibomcasibom girişEskişehir escortjojobetbakırköy escortdeneme bonusu veren sitelerhalkali escortgrandpashabet girişholiganbet güncel girişankara escort bayancasino siteleriultrabetgrandpashabet girişholiganbetonwinholiganbetgrandpashabetesenyurt anal escortTümbetnakitbahiscasibom girişgrandpashabetİstanbul Escorthttps://www.gvscolombia.com/betebetdeneme bonusu veren sitelerJojobet GirişstarzbetsavoybettingsavoybettingjojobetfixbetBetturkey girişcasibom güncel girişkucukcekmece escortholiganbetimajbetkingroyalmadridbetmatbetmavibetmeritbetmeritkingonwinotobetmeritbetimajbetcasibomsekabetbetvolebetordercasinolevantArtemisbetmadridbetmavibetmeritking girişotobetjojobetholiganbetholiganbet girişonwincasibom girişcasibom girişsahabet girişmadridbetbetturkey girişmarsbahis giriş güncelsahabet güncel giriştipobetistanbul escortscanlı bahisstarzbetultrabetjojobetenbetvbettrromabetcasibom girişcasibomcasibom güncel girişjojobetmegabahisjojobet girişmarsbahiszbahisperabetbakırköy escortdeneme bonusu veren sitelerbetebet güncel girişdumanbetsightcarebilyoneronwinonwinsahabetbets10,bets10 giriş,bets10 güncel giriştipobetmarsbahis,marsbahis güncel giriş , marsbahis giriş,marsbahis adresmarsbahis,marsbahis güncel giriş , marsbahis giriş,marsbahis adressekabetpradabettarafbetmilanobetmilanobetpusulabettempobetpusulabettempobetpusulabetjojobetbets10madridbetBostancı escort Bağcılar escortmatbetjojobet,jojobet girişsekabet girişjojobet,jojobet girişjojobetizmir escortcasibomtipobetjasminbetİstanbul Escortbahis sitelericasibomjojobet girişJojobet Girişankara escortzbahiszbahis girişzbahis güncel girişholiganbetcasibomsonbahisdeneme bonusu veren siteler 2025vaycasinocasinomaxizbahisotobet girişimajbetcasibomvaycasinojojobetbetturkeymarsbahis girişmatbet girişmarsbahisbetturkeybetexperdeneme bonusu veren sitelermariobetwinxbetbetexperbetofficegonebetgrandpashabetgrandpashabet güncelpusulabetpusulabetcasibom girişonwin,onwin giriş,onwin güncel giriş,onwin giriş adresitipobetbetebetmarsbahisultrabetholiganbetjojobetfixbetkulisbetnakitbahispinbahisrestbettipobettrendbetultrabetjojobetholiganbetotobetbetexperpusulabetasyabahisparibahiskulisbettipobetHoliganbet girişfixbetvaycasinojojobet,jojobet girişonwinhttps://sahipleniyorum.com/jojobetjojobet girişultrabetmatbetcasibomcasibom girişmaltepe escortextrabet girişmecidiyeköy escortsekabet girişjojobettipobetbetturkeygonabettipobetcasibom girişmavibetmavibet girişmaltcasinomaltcasino girişmavibet güncelJojobet girişMAVİBETİMAJBETextrabetzbahismarsbahisizmit escortcasibom giriştakipçi hilesivaycasinocashback girişjojobetgonebetjojobetjojobetgüncel girişcasinoroyalcasibom