c programming video tutorial - diamond shape pattern printing

preview_player
Показать описание
c programming video tutorial - diamond shape pattern printing. In this video tutorial we are going to learn how to write a progeam in the diamond shape using "*".In this tutorial we use nested loops, means one loop inside other. If you see this tutorial you can get a clear idea about loops.

All pattern printing tutorials are here. Here we print the stars in different format.

To learn C programming from beginning click on the link provided below.

Complete series of data structures video with C coding is here.

C++ tutorial for beginners.

Tips and trick videos on computer,facebook,twitter,gmail,google etc are here.

Sorting and searching algorithm with coding.

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

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
Автор

Thank you a lot! I have such a hard time programming and this was a simple but very easy to follow and understand video

Samuel-qgbh
Автор

my most inamorato coding utube channel....bro...u r a genius with sophisticated expositions.
please upload more difficult pattern videos ...so that we can clinch how to create a logic in a rationale way...

saadmanahmed
Автор

very beautifully explained sir, keep it up 👍👍

SmartProgramming
Автор

For n=7 input.. pattern should print 7 rows

kaushikaditya
Автор

same code is not working for python .in second part it ended up printing 3 stars .also getting that pattern only if i use 2*row.could any one explain this?

tejaswiganasala
Автор

thank you for helping. my ass will be toasted if not for your video...

hayyihahd
Автор

Love u so much 😘❤️❤️❤️❤️❤️❤️❤️ helpness

monorumborith
Автор

video me bahut noise ah raha hai bro,

khademali