SlideShare a Scribd company logo
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.
Ad

More Related Content

What's hot (20)

C programming - String
C programming - StringC programming - String
C programming - String
Achyut Devkota
 
Constants, Variables and Data Types in Java
Constants, Variables and Data Types in JavaConstants, Variables and Data Types in Java
Constants, Variables and Data Types in Java
Abhilash Nair
 
CONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGECONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGE
Ideal Eyes Business College
 
Array in C
Array in CArray in C
Array in C
Kamal Acharya
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
topu93
 
StringTokenizer in java
StringTokenizer in javaStringTokenizer in java
StringTokenizer in java
Muthukumaran Subramanian
 
Method overloading, recursion, passing and returning objects from method, new...
Method overloading, recursion, passing and returning objects from method, new...Method overloading, recursion, passing and returning objects from method, new...
Method overloading, recursion, passing and returning objects from method, new...
JAINAM KAPADIYA
 
C if else
C if elseC if else
C if else
Ritwik Das
 
Java Notes
Java Notes Java Notes
Java Notes
Sreedhar Chowdam
 
Networking in python by Rj
Networking in python by RjNetworking in python by Rj
Networking in python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Strings
StringsStrings
Strings
Nilesh Dalvi
 
C# Arrays
C# ArraysC# Arrays
C# Arrays
Hock Leng PUAH
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
kamal kotecha
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
v_jk
 
Function in c
Function in cFunction in c
Function in c
savitamhaske
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
Kamal Acharya
 
Regular Expressions in Java
Regular Expressions in JavaRegular Expressions in Java
Regular Expressions in Java
OblivionWalker
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
Vineeta Garg
 
String functions in C
String functions in CString functions in C
String functions in C
baabtra.com - No. 1 supplier of quality freshers
 
Java IO
Java IOJava IO
Java IO
UTSAB NEUPANE
 

Viewers also liked (15)

CV[1]
CV[1]CV[1]
CV[1]
kamal kumar
 
How to write c program with code blocks
How to write c program with code blocksHow to write c program with code blocks
How to write c program with code blocks
Sourav Ganguly
 
OpenWare ThinkGIS
OpenWare ThinkGISOpenWare ThinkGIS
OpenWare ThinkGIS
Andrew Zolnai
 
C programming language character set keywords constants variables data types
C programming language character set keywords constants variables data typesC programming language character set keywords constants variables data types
C programming language character set keywords constants variables data types
Sourav Ganguly
 
Reede for integrated POP display
Reede for  integrated POP displayReede for  integrated POP display
Reede for integrated POP display
Karen Chen
 
ศิลป์ ทวารวดี ศรีวิชัย ลพบุรี
ศิลป์ ทวารวดี ศรีวิชัย ลพบุรีศิลป์ ทวารวดี ศรีวิชัย ลพบุรี
ศิลป์ ทวารวดี ศรีวิชัย ลพบุรี
Pattharapong Sirisuwan
 
Classroom management approaches and Theories and models of classroom management
Classroom management approaches and Theories and models of classroom managementClassroom management approaches and Theories and models of classroom management
Classroom management approaches and Theories and models of classroom management
yusnithamerang
 
Facultad de ingenieria de sistemas uniremignton engenier 2010
Facultad de ingenieria de sistemas uniremignton engenier 2010Facultad de ingenieria de sistemas uniremignton engenier 2010
Facultad de ingenieria de sistemas uniremignton engenier 2010
Miguel Angel Guevara
 
رضا مصطفوی طباطبایی
رضا مصطفوی طباطباییرضا مصطفوی طباطبایی
رضا مصطفوی طباطبایی
Reza Mostafavi Tabatabaei
 
RAKESH_KUMAR_ANGURAL_14Sep2015(long)
RAKESH_KUMAR_ANGURAL_14Sep2015(long)RAKESH_KUMAR_ANGURAL_14Sep2015(long)
RAKESH_KUMAR_ANGURAL_14Sep2015(long)
Rakesh Angural
 
William Professional Resume
William Professional ResumeWilliam Professional Resume
William Professional Resume
William Bullock
 
Top7ReasonsPreventativeMaintenanceCity
Top7ReasonsPreventativeMaintenanceCityTop7ReasonsPreventativeMaintenanceCity
Top7ReasonsPreventativeMaintenanceCity
Alecia Flahiff
 
Estadisticas veredal 6
Estadisticas veredal 6Estadisticas veredal 6
Estadisticas veredal 6
TORNEOS INDER GUARNE
 
y-HR-Loama - LinkedIn
y-HR-Loama - LinkedIny-HR-Loama - LinkedIn
y-HR-Loama - LinkedIn
Emad Qabbani
 
How to write c program with code blocks
How to write c program with code blocksHow to write c program with code blocks
How to write c program with code blocks
Sourav Ganguly
 
C programming language character set keywords constants variables data types
C programming language character set keywords constants variables data typesC programming language character set keywords constants variables data types
C programming language character set keywords constants variables data types
Sourav Ganguly
 
Reede for integrated POP display
Reede for  integrated POP displayReede for  integrated POP display
Reede for integrated POP display
Karen Chen
 
ศิลป์ ทวารวดี ศรีวิชัย ลพบุรี
ศิลป์ ทวารวดี ศรีวิชัย ลพบุรีศิลป์ ทวารวดี ศรีวิชัย ลพบุรี
ศิลป์ ทวารวดี ศรีวิชัย ลพบุรี
Pattharapong Sirisuwan
 
Classroom management approaches and Theories and models of classroom management
Classroom management approaches and Theories and models of classroom managementClassroom management approaches and Theories and models of classroom management
Classroom management approaches and Theories and models of classroom management
yusnithamerang
 
Facultad de ingenieria de sistemas uniremignton engenier 2010
Facultad de ingenieria de sistemas uniremignton engenier 2010Facultad de ingenieria de sistemas uniremignton engenier 2010
Facultad de ingenieria de sistemas uniremignton engenier 2010
Miguel Angel Guevara
 
RAKESH_KUMAR_ANGURAL_14Sep2015(long)
RAKESH_KUMAR_ANGURAL_14Sep2015(long)RAKESH_KUMAR_ANGURAL_14Sep2015(long)
RAKESH_KUMAR_ANGURAL_14Sep2015(long)
Rakesh Angural
 
William Professional Resume
William Professional ResumeWilliam Professional Resume
William Professional Resume
William Bullock
 
Top7ReasonsPreventativeMaintenanceCity
Top7ReasonsPreventativeMaintenanceCityTop7ReasonsPreventativeMaintenanceCity
Top7ReasonsPreventativeMaintenanceCity
Alecia Flahiff
 
y-HR-Loama - LinkedIn
y-HR-Loama - LinkedIny-HR-Loama - LinkedIn
y-HR-Loama - LinkedIn
Emad Qabbani
 
Ad

Similar to C program language tutorial pattern printing (20)

C program language tutorial for loop while loop do while loop
C program language tutorial for loop while loop do while loopC program language tutorial for loop while loop do while loop
C program language tutorial for loop while loop do while loop
Sourav Ganguly
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
Kiwamu Okabe
 
Kotlin
KotlinKotlin
Kotlin
BoKaiRuan
 
Introduction to C Programming -Lecture 3
Introduction to C Programming -Lecture 3Introduction to C Programming -Lecture 3
Introduction to C Programming -Lecture 3
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
Siva Arunachalam
 
Simple c program
Simple c programSimple c program
Simple c program
Ravi Singh
 
C SLIDES PREPARED BY M V B REDDY
C SLIDES PREPARED BY  M V B REDDYC SLIDES PREPARED BY  M V B REDDY
C SLIDES PREPARED BY M V B REDDY
Malikireddy Bramhananda Reddy
 
pattern-printing-in-c.pdf
pattern-printing-in-c.pdfpattern-printing-in-c.pdf
pattern-printing-in-c.pdf
RSathyaPriyaCSEKIOT
 
Being Expressive in Code
Being Expressive in CodeBeing Expressive in Code
Being Expressive in Code
Eamonn Boyle
 
Python Peculiarities
Python PeculiaritiesPython Peculiarities
Python Peculiarities
noamt
 
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2014]
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2014][Question Paper] Introduction To C++ Programming (Revised Course) [April / 2014]
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2014]
Mumbai B.Sc.IT Study
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
Stefan
 
Stars
StarsStars
Stars
Gurpreet singh
 
CP Handout#5
CP Handout#5CP Handout#5
CP Handout#5
trupti1976
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
Mahira Banu
 
Loops in Python.pptx
Loops in Python.pptxLoops in Python.pptx
Loops in Python.pptx
Guru Nanak Dev University, Amritsar
 
Python for Scientific Computing -- Ricardo Cruz
Python for Scientific Computing -- Ricardo CruzPython for Scientific Computing -- Ricardo Cruz
Python for Scientific Computing -- Ricardo Cruz
rpmcruz
 
Pslb lab manual
Pslb lab manualPslb lab manual
Pslb lab manual
Vivek Kumar Sinha
 
Introduction to programming - class 11
Introduction to programming - class 11Introduction to programming - class 11
Introduction to programming - class 11
Paul Brebner
 
Music as data
Music as dataMusic as data
Music as data
John Vlachoyiannis
 
C program language tutorial for loop while loop do while loop
C program language tutorial for loop while loop do while loopC program language tutorial for loop while loop do while loop
C program language tutorial for loop while loop do while loop
Sourav Ganguly
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
Kiwamu Okabe
 
Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
Siva Arunachalam
 
Simple c program
Simple c programSimple c program
Simple c program
Ravi Singh
 
Being Expressive in Code
Being Expressive in CodeBeing Expressive in Code
Being Expressive in Code
Eamonn Boyle
 
Python Peculiarities
Python PeculiaritiesPython Peculiarities
Python Peculiarities
noamt
 
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2014]
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2014][Question Paper] Introduction To C++ Programming (Revised Course) [April / 2014]
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2014]
Mumbai B.Sc.IT Study
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
Stefan
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
Mahira Banu
 
Python for Scientific Computing -- Ricardo Cruz
Python for Scientific Computing -- Ricardo CruzPython for Scientific Computing -- Ricardo Cruz
Python for Scientific Computing -- Ricardo Cruz
rpmcruz
 
Introduction to programming - class 11
Introduction to programming - class 11Introduction to programming - class 11
Introduction to programming - class 11
Paul Brebner
 
Ad

Recently uploaded (20)

Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...
Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...
Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...
National Information Standards Organization (NISO)
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 

C program language tutorial pattern printing

  • 1. C language Pattern Print Copyright © 2015 · Sourav Ganguly · All Rights Reserved.
  • 2. 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.
  • 3. 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.
  • 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 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
  • 7. 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”);
  • 8. 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
  • 9. 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"); }
  • 10. 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
  • 11. 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)
  • 12. 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)
  • 13. 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)
  • 14. 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.