C language Pattern Print
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Sourav Ganguly
Please visit my Youtube channel
Step 1: go to www.google.com
Step 2: Search for “sourav ganguly c programming”.
Step 3: Click on my image bottom of the video. You will reach my
channel.
Youtube (direct link):
https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg
Website:
http://www.startselfstudy.blogspot.in
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
What is pattern of C language…..
Different types of pattern in C language…..
Secret of pattern printing in C language…..
Discover the secret of pattern printing …..
How print pattern with loops in C language…..
Pattern printing example with real program…..
[Live Demo on YouTube channel]
Index
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
*
***
*****
*******
*******
*****
***
*
When we display something with some special order then it is
called pattern.
What is pattern of C language…..
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
*
**
***
****
@
@@
@@@
@@@@
$$$$
$$$
$$
$
####
###
##
#
****
****
****
****
!
!!!
!!!!!
!!!!!!!
&&&&&&&
&&&&&
&&&
&
*****
*
*
*****
Different types of pattern in C language…..
Secret of pattern printing in C language….. contd…
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
Computer
Screen
Column
1
Column
2
Column
3
Column
4
Row
1
Row
2
Row
3
Row
4
Raster Scan Display
Row 1
Column 1
Secret of pattern printing in C language….. contd…
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
*
* *
* * *
* * * *
Computer
Screen
Column
1
Column
2
Column
3
Column
4
Row
1
Row
2
Row
3
Row
4
Space -> printf(“ ”);
Symbol -> printf(“*”);
Next line -> printf(“n”);
Discover the secret of pattern printing …..
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
*
* *
* * *
* * * *
Computer
Screen
Column
1
Column
2
Column
3
Column
4
Row
1
Row
2
Row
3
Row
4
Row
No.
Space
No.
Star
No.
Total
Row
1 3 1 4
2 2 2 4
3 1 3 4
4 0 4 4
Write this table.
Calculate the relation.
Relation:
Space No = (Total Row – Row No)
Star No = Row No
How print pattern with loops in C language…..contd…
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
*
* *
* * *
* * * *
for(row=1 ; row<=4 ; row=row+1)
{
for(space=1 ; space<=(4-row) ; space=space+1)
{
printf(" ");
}
for(star=1 ; star<=row ; star=star+1)
{
printf("*");
}
printf("n");
}
How print pattern with loops in C language….. contd…
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
*
* *
* * *
* * * *
for(row=1 ; row<=4 ; row=row+1)
{
for(space=1 ; space<=(4-row) ; space=space+1)
{
printf(" ");
}
for(star=1 ; star<=row ; star=star+1)
{
printf("*");
}
printf("n");
}
Row
No.
Space
No.
Star
No.
Total
Row
1 0 1 4
2 0 2 4
3 0 3 4
4 0 4 4
Relation:
Space No = 0
Star No = Row No
How print pattern with loops in C language….. contd…
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
* * * *
* * *
* *
*
for(row=1 ; row<=4 ; row=row+1)
{
for(space=1 ; space<=(4-row) ; space=space+1)
{
printf(" ");
}
for(star=4 ; star>=row ; star=star-1)
{
printf("*");
}
printf("n");
}
Row
No.
Space
No.
Star
No.
Total
Row
1 0 4 4
2 0 3 4
3 0 2 4
4 0 1 4
Relation:
Space No = 0
Star No = Row No (reverse order)
How print pattern with loops in C language….. contd…
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
* * * *
* * *
* *
*
for(row=1 ; row<=4 ; row=row+1)
{
for(space=1 ; space<=(row-1) ; space=space+1)
{
printf(" ");
}
for(star=4 ; star>=row ; star=star-1)
{
printf("*");
}
printf("n");
}
Row
No.
Space
No.
Star
No.
Total
Row
1 0 4 4
2 1 3 4
3 2 2 4
4 3 1 4
Relation:
Space No = (Row No – 1)
Star No = Row No (reverse order)
How print pattern with loops in C language….. contd…
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
*
* * *
* * * * *
* * * * * * *
for(row=1 ; row<=4 ; row=row+1)
{
for(space=1 ; space<=(4-row) ; space=space+1)
{
printf(" ");
}
for(star=1 ; star>=((row*2)-1) ; star=star+1)
{
printf("*");
}
printf("n");
}
Row
No.
Space
No.
Star
No.
Total
Row
1 3 1 4
2 2 3 4
3 1 5 4
4 0 7 4
Relation:
Space No = (Total Row - Row No)
Star No = ((Row No * 2) -1)
Sourav Ganguly
Please visit my Youtube channel
Step 1: go to www.google.com
Step 2: Search for “sourav ganguly c programming”.
Step 3: Click on my image bottom of the video. You will reach my
channel.
Youtube (direct link):
https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg
Website:
http://www.startselfstudy.blogspot.in
Copyright © 2015 · Sourav Ganguly · All Rights Reserved.

C program language tutorial pattern printing

  • 1.
    C language PatternPrint Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 2.
    Sourav Ganguly Please visitmy Youtube channel Step 1: go to www.google.com Step 2: Search for “sourav ganguly c programming”. Step 3: Click on my image bottom of the video. You will reach my channel. Youtube (direct link): https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg Website: http://www.startselfstudy.blogspot.in Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 3.
    What is patternof C language….. Different types of pattern in C language….. Secret of pattern printing in C language….. Discover the secret of pattern printing ….. How print pattern with loops in C language….. Pattern printing example with real program….. [Live Demo on YouTube channel] Index Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 4.
    Copyright © 2015· Sourav Ganguly · All Rights Reserved. * *** ***** ******* ******* ***** *** * When we display something with some special order then it is called pattern. What is pattern of C language…..
  • 5.
    Copyright © 2015· Sourav Ganguly · All Rights Reserved. * ** *** **** @ @@ @@@ @@@@ $$$$ $$$ $$ $ #### ### ## # **** **** **** **** ! !!! !!!!! !!!!!!! &&&&&&& &&&&& &&& & ***** * * ***** Different types of pattern in C language…..
  • 6.
    Secret of patternprinting in C language….. contd… Copyright © 2015 · Sourav Ganguly · All Rights Reserved. Computer Screen Column 1 Column 2 Column 3 Column 4 Row 1 Row 2 Row 3 Row 4 Raster Scan Display Row 1 Column 1
  • 7.
    Secret of patternprinting in C language….. contd… Copyright © 2015 · Sourav Ganguly · All Rights Reserved. * * * * * * * * * * Computer Screen Column 1 Column 2 Column 3 Column 4 Row 1 Row 2 Row 3 Row 4 Space -> printf(“ ”); Symbol -> printf(“*”); Next line -> printf(“n”);
  • 8.
    Discover the secretof pattern printing ….. Copyright © 2015 · Sourav Ganguly · All Rights Reserved. * * * * * * * * * * Computer Screen Column 1 Column 2 Column 3 Column 4 Row 1 Row 2 Row 3 Row 4 Row No. Space No. Star No. Total Row 1 3 1 4 2 2 2 4 3 1 3 4 4 0 4 4 Write this table. Calculate the relation. Relation: Space No = (Total Row – Row No) Star No = Row No
  • 9.
    How print patternwith loops in C language…..contd… Copyright © 2015 · Sourav Ganguly · All Rights Reserved. * * * * * * * * * * for(row=1 ; row<=4 ; row=row+1) { for(space=1 ; space<=(4-row) ; space=space+1) { printf(" "); } for(star=1 ; star<=row ; star=star+1) { printf("*"); } printf("n"); }
  • 10.
    How print patternwith loops in C language….. contd… Copyright © 2015 · Sourav Ganguly · All Rights Reserved. * * * * * * * * * * for(row=1 ; row<=4 ; row=row+1) { for(space=1 ; space<=(4-row) ; space=space+1) { printf(" "); } for(star=1 ; star<=row ; star=star+1) { printf("*"); } printf("n"); } Row No. Space No. Star No. Total Row 1 0 1 4 2 0 2 4 3 0 3 4 4 0 4 4 Relation: Space No = 0 Star No = Row No
  • 11.
    How print patternwith loops in C language….. contd… Copyright © 2015 · Sourav Ganguly · All Rights Reserved. * * * * * * * * * * for(row=1 ; row<=4 ; row=row+1) { for(space=1 ; space<=(4-row) ; space=space+1) { printf(" "); } for(star=4 ; star>=row ; star=star-1) { printf("*"); } printf("n"); } Row No. Space No. Star No. Total Row 1 0 4 4 2 0 3 4 3 0 2 4 4 0 1 4 Relation: Space No = 0 Star No = Row No (reverse order)
  • 12.
    How print patternwith loops in C language….. contd… Copyright © 2015 · Sourav Ganguly · All Rights Reserved. * * * * * * * * * * for(row=1 ; row<=4 ; row=row+1) { for(space=1 ; space<=(row-1) ; space=space+1) { printf(" "); } for(star=4 ; star>=row ; star=star-1) { printf("*"); } printf("n"); } Row No. Space No. Star No. Total Row 1 0 4 4 2 1 3 4 3 2 2 4 4 3 1 4 Relation: Space No = (Row No – 1) Star No = Row No (reverse order)
  • 13.
    How print patternwith loops in C language….. contd… Copyright © 2015 · Sourav Ganguly · All Rights Reserved. * * * * * * * * * * * * * * * * for(row=1 ; row<=4 ; row=row+1) { for(space=1 ; space<=(4-row) ; space=space+1) { printf(" "); } for(star=1 ; star>=((row*2)-1) ; star=star+1) { printf("*"); } printf("n"); } Row No. Space No. Star No. Total Row 1 3 1 4 2 2 3 4 3 1 5 4 4 0 7 4 Relation: Space No = (Total Row - Row No) Star No = ((Row No * 2) -1)
  • 14.
    Sourav Ganguly Please visitmy Youtube channel Step 1: go to www.google.com Step 2: Search for “sourav ganguly c programming”. Step 3: Click on my image bottom of the video. You will reach my channel. Youtube (direct link): https://www.youtube.com/channel/UCDsQskBhM107VIYLjg8kczg Website: http://www.startselfstudy.blogspot.in Copyright © 2015 · Sourav Ganguly · All Rights Reserved.