40 | Java Program to Print Diamond Pattern | Java Nested For Loop

preview_player
Показать описание
Preparing for the java interview or exam? Checkout my color-coded Java Revision Book that is specially designed for refreshing java concepts

Don't be a stranger '-'

Connect with me on the below platforms.

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

Thank you soo chirag sir ji, i finished all your 40 programs, and I'm soo impressed after watching these all vedio's
You didn't a great job sir ji
I want this type learning for further code's,
Please continue the further topic's sir ji
I want to learn Oop's concepts from you gudencies

UdayKumar-ntnv
Автор

This is the great video i could find for patterns.awesome. keep it up!!

anuradhae
Автор

So much fun watching your videos, keep going to more advanced topics.

anxhelocenollari
Автор

Finished all the 40 questions, they were awesome!!!! we defiantly need more sir!

kader_studio
Автор

Inka ilaanti videos pettandi sir.... Tq fr u explanation
🎉

pothulasusmitha
Автор

மிக்க நன்றி சார்... எனக்கு நன்றாக புரிந்தது..

suyakisaneeshwar
Автор

It was so much fun watching and solved all 40 questions ! TY Chirag!

kangoh
Автор

Shortest and Smart code for diamond pattern in just 2 FOR loops..
Output verified on Turbo C IDE..

#include <stdio.h>
#include <math.h>
#include <conio.h>

void main()
{
int n, row, col, flag=0;
printf("Enter Number");
scanf("%d", &n);

for(row=1; row>=1; row++)
{
for(col=1; col<n*2; col++)
{

if(abs(n-col)+1>=row)
printf("*");
else
printf(" ");

}
printf("\n");

if(row==n)
flag=1;

if(flag==1)
row = row-2;
}

}

yuvrajadkar