Pattern-19 | Solution | Java Foundation Course

preview_player
Показать описание

NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we will discuss the solution where we are required to print pattern 19.

--------------------------------------------------------------------------------------------------------------------------------------------------------------

Pepcoding has taken the initiative to provide counselling and learning resources to all curious, skillful and dedicated Indian coders. This video is part of the series to impart industry-level web development and programming skills in the community.

We also provide professional courses with live classes and placement opportunities.

DSA Level 1 and Level 2

Webinar on GATE Preparation

We are also available on the following social media platforms: -

HAPPY PROGRAMMING!
Pep it up.....

Hashtags

#java #javafoundation #pattern19
Рекомендации по теме
Комментарии
Автор

Sir bas parts mein divide krne ka hint pata chlgya aur maine question khud karliya. Thanks :)

saksham
Автор

Thanks a lot sir, nice explanation...it is very helpful . I truly love your explanations and the way you approaches to difficult patterns as well. But it is not swastik sir, it is mirror image of swastik .

priyagrajsharma
Автор

sir i am in 1st year 2020 admisiion batch. Your teaching style is very unique and helps a lot in logic building. I m hoping to complete the whole course of yours

priyanshubharadwaj
Автор

Sir yaha par jo स्वस्तिक banaya gaya hai wo anticlockwise hai jo galat hai
Asal mai स्वस्तिक clockwise direction mai hota hai

Hindu_You
Автор

Sir, Thank you for awesome logic, sometimes can't think of it directly in few minutes....

indiansoftwareengineer
Автор

Mahaul Dharmik Ho Gya Sir But loved your way of teaching😍

adhargupta
Автор

Wow this logic was literally very easy to understand thankyou for such amazing content ;)

Alldata
Автор

Thank you so much sir!! breaking logic into parts is Awesome.

sakshiaggarwal
Автор

Or we can do it in one condition -

for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
if(i == n/2+1
j == n/2+1
(i == 1 && j < n/2+1)
(j == n && i < n/2+1)
(i == n && j > n/2)
(j == 1 && i > n/2)) {

} else {

}
}

System.out.println();
}

im_prasantkumar
Автор

My code in first try. Is it good?
for(int i=1;i<=n;i++){
if(i==1){
for(int j=1;j<=n/2+1;j++){
System.out.print("* ");
}
for(int j=1;j<=n/2-1;j++){
System.out.print(" ");
}
System.out.print("* ");
}
else if(i==n){
System.out.print("* ");
for(int j=1;j<=n/2-1;j++){
System.out.print(" ");
}
for(int j=1;j<=n/2+1;j++){
System.out.print("* ");
}
}
else if(i<=n/2){
for(int j=1;j<=n/2;j++){
System.out.print(" ");
}
System.out.print("* ");
for(int j=1;j<=n/2-1;j++){
System.out.print(" ");
}
System.out.print("* ");
}
else if(i>n/2+1){
System.out.print("* ");
for(int j=1;j<=n/2-1;j++){
System.out.print(" ");
}
System.out.print("* ");
for(int j=1;j<=n/2;j++){
System.out.print(" ");
}
}
else{
for(int j=1;j<=n;j++){
System.out.print("* ");
}
}
System.out.println();
}

rockpraneeth
join shbcf.ru