SlideShare a Scribd company logo
1 of 76
Tushar B. Kute, Department of Information Technology, Sandip Institute of Technology and Research Centre, Nashik An Imperative Study of ‘C’
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why ‘C’ only?
Problem Solving ,[object Object],[object Object],[object Object],[object Object],[object Object]
Two views of program user interface software layers hidden by user interface user’s view programmer’s view
Alphabets, Digits, Special Symbols. Constants, Variables, And Keywords Instructions Program. Forming a C program
Compiling a C program
Basic Programming Concepts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sample C Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Control Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
if  Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Condition ? statement1 statement2 statement3 true false
The  if...else  Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
if...else  Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multiple Alternative if Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],if (score >= 90) grade = ‘A’; else if (score >= 80) grade = ‘B’; else if (score >= 70)  grade = ‘C’; else if (score >= 60) grade = ‘D’; else  grade = ‘F’;
switch   Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
switch  Statement Flow Chart
Repetitions ,[object Object],[object Object],[object Object],[object Object]
while  Loop while (continuation-condition)  { // loop-body; }
while  Loop Flow Chart, cont. int i = 0; while (i < 100) { printf(&quot;Welcome to C!&quot;); i++; }
do-while  Loop do { // Loop body; } while (continue-condition);
for  Loop  for (initialization; condition; increment/decrement) { //loop body; }
Caution ,[object Object],[object Object],[object Object],[object Object],[object Object],Wrong
Caution, cont. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Wrong Correct
Which Loop to Use?
The  break  Keyword
Example:  break  statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The  continue  Keyword
Example:  continue  statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arrays Array is a data structure that represents a collection of the same types of data.  An Array of 10 Elements of type  int
Declaring Array Variables ,[object Object],[object Object],[object Object],[object Object],[object Object]
Creating Arrays ,[object Object],[object Object],[object Object],[object Object],[object Object]
Declaring and Creating in One Step ,[object Object],[object Object],[object Object],[object Object]
The Length of Arrays ,[object Object],[object Object],[object Object],[object Object],[object Object]
Declaring, creating, initializing Using the Shorthand Notation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CAUTION ,[object Object],[object Object],[object Object]
Copying Arrays ,[object Object],[object Object],[object Object],[object Object]
Multidimensional Arrays ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multidimensional Array Illustration
Function
What is a Function ? ,[object Object],[object Object],[object Object]
Types of Functions ,[object Object],[object Object],[object Object],[object Object],[object Object]
User defined functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Declaration of many functions. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some conclusions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summarization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summarization Contd………. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summarization Contd………. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summarization Contd………. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why use functions ? ,[object Object],[object Object]
Passing values to functions. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],i, j, k are actual arguments x, y, z are formal arguments.
Returning a value ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
return ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Function declaration and Prototype. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Function prototype.
Structures ,[object Object],[object Object]
‘ C’ implementation of Structure. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Accessing structure elements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How structure elements are stored ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],z.name  z.pages  z.price   ‘ s’ 125 90.0
Valid declaration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Remember: ,[object Object],[object Object],[object Object]
Example: Creating a student database of 3 students. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Array of structures ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Memory map for arrays a[i].roll  a[i].name  a[i].marks i 2 1 9 3 0 7 6 5 4 8 a[5].roll a[9].name
Pointers
Pointer Variables ,[object Object],[object Object],[object Object],int * p; /*  variable  p  can hold the address of a   memory location that contains an  int  */ char * chptr; /*  chptr  can hold the address of a   memory location that contains a  char   */
Dereferencing Operator ,[object Object],[object Object],[object Object],int *p; p ? *p = 7; Address in  p  could be any memory location Attempt to put a value into an unknown memory location will result in a  run-time error , or worse, a  logic error
[object Object],[object Object],[object Object],[object Object],Pointer
The Address Operator ,[object Object],[object Object],int x, *p; p ? x ? p = &x; *p = 4; p x ? p x 4 Value of  x  has been changed Value of  p  has been changed
The Null Pointer ,[object Object],[object Object]
Pointer Example int *p, x, y, *q = NULL; p = &x; *p = 4; p x  (or *p) y 4 ? p = &y; p x  y 4 ? *p   is now another name for   y q q . .
*p = 8; p x  y 4 8 q = p; p x  y 4 8 q *p or *q q *p .
p = &x; p x  y 4 8 *q *p = *q; p x  y 8 8 q *p q *p *q 8
Arrays of Pointers ,[object Object],[object Object],int j = 6; k = 4; int * arrayOfPtr[4]; j k 6 4 arrayOfPtr ? ? ? ? 0 1 2 3 Pointers in array are not initialized yet
arrayOfPtr[0] = &k;  arrayOfPtr[2]=&j;  j k 6 4 arrayOfPtr ? 0 1 2 3 ?
Array Names as Pointers ,[object Object],[object Object],[object Object],[object Object],[object Object]
Functions Calls ,[object Object],[object Object]
References ,[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

C Prog - Functions
C Prog - FunctionsC Prog - Functions
C Prog - Functions
vinay arora
 
FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3
rohassanie
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5
alish sha
 

What's hot (20)

Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)
 
C Prog - Functions
C Prog - FunctionsC Prog - Functions
C Prog - Functions
 
lets play with "c"..!!! :):)
lets play with "c"..!!! :):)lets play with "c"..!!! :):)
lets play with "c"..!!! :):)
 
Function & Recursion in C
Function & Recursion in CFunction & Recursion in C
Function & Recursion in C
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1
 
8 arrays and pointers
8  arrays and pointers8  arrays and pointers
8 arrays and pointers
 
C programming function
C  programming functionC  programming function
C programming function
 
Functions
FunctionsFunctions
Functions
 
4 operators, expressions &amp; statements
4  operators, expressions &amp; statements4  operators, expressions &amp; statements
4 operators, expressions &amp; statements
 
C tech questions
C tech questionsC tech questions
C tech questions
 
C++11
C++11C++11
C++11
 
FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3
 
Unit 5 Foc
Unit 5 FocUnit 5 Foc
Unit 5 Foc
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
Advanced C - Part 2
Advanced C - Part 2Advanced C - Part 2
Advanced C - Part 2
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5
 
1 introducing c language
1  introducing c language1  introducing c language
1 introducing c language
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6
 
9 character string &amp; string library
9  character string &amp; string library9  character string &amp; string library
9 character string &amp; string library
 

Viewers also liked (6)

Module 01 Introduction to Linux
Module 01 Introduction to LinuxModule 01 Introduction to Linux
Module 01 Introduction to Linux
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.
 
See through C
See through CSee through C
See through C
 
Internal components of PC
Internal components of PCInternal components of PC
Internal components of PC
 
C ppt
C pptC ppt
C ppt
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 

Similar to An imperative study of c

1. DSA - Introduction.pptx
1. DSA - Introduction.pptx1. DSA - Introduction.pptx
1. DSA - Introduction.pptx
hara69
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...
kushwahashivam413
 

Similar to An imperative study of c (20)

Function in c program
Function in c programFunction in c program
Function in c program
 
C programming
C programmingC programming
C programming
 
C intro
C introC intro
C intro
 
Functions
FunctionsFunctions
Functions
 
Embedded C - Day 2
Embedded C - Day 2Embedded C - Day 2
Embedded C - Day 2
 
1. DSA - Introduction.pptx
1. DSA - Introduction.pptx1. DSA - Introduction.pptx
1. DSA - Introduction.pptx
 
Code optimization
Code optimization Code optimization
Code optimization
 
Code optimization
Code optimization Code optimization
Code optimization
 
Assignment c programming
Assignment c programmingAssignment c programming
Assignment c programming
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...
 
CHAPTER 6
CHAPTER 6CHAPTER 6
CHAPTER 6
 
Array Cont
Array ContArray Cont
Array Cont
 
C programming
C programmingC programming
C programming
 
Function in c
Function in cFunction in c
Function in c
 
C function
C functionC function
C function
 
Unit2 C
Unit2 C Unit2 C
Unit2 C
 
Unit2 C
Unit2 CUnit2 C
Unit2 C
 
chapter-6 slide.pptx
chapter-6 slide.pptxchapter-6 slide.pptx
chapter-6 slide.pptx
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan Kumari
 

More from Tushar B Kute

More from Tushar B Kute (20)

Apache Pig: A big data processor
Apache Pig: A big data processorApache Pig: A big data processor
Apache Pig: A big data processor
 
01 Introduction to Android
01 Introduction to Android01 Introduction to Android
01 Introduction to Android
 
Ubuntu OS and it's Flavours
Ubuntu OS and it's FlavoursUbuntu OS and it's Flavours
Ubuntu OS and it's Flavours
 
Install Drupal in Ubuntu by Tushar B. Kute
Install Drupal in Ubuntu by Tushar B. KuteInstall Drupal in Ubuntu by Tushar B. Kute
Install Drupal in Ubuntu by Tushar B. Kute
 
Install Wordpress in Ubuntu Linux by Tushar B. Kute
Install Wordpress in Ubuntu Linux by Tushar B. KuteInstall Wordpress in Ubuntu Linux by Tushar B. Kute
Install Wordpress in Ubuntu Linux by Tushar B. Kute
 
Share File easily between computers using sftp
Share File easily between computers using sftpShare File easily between computers using sftp
Share File easily between computers using sftp
 
Signal Handling in Linux
Signal Handling in LinuxSignal Handling in Linux
Signal Handling in Linux
 
Implementation of FIFO in Linux
Implementation of FIFO in LinuxImplementation of FIFO in Linux
Implementation of FIFO in Linux
 
Implementation of Pipe in Linux
Implementation of Pipe in LinuxImplementation of Pipe in Linux
Implementation of Pipe in Linux
 
Basic Multithreading using Posix Threads
Basic Multithreading using Posix ThreadsBasic Multithreading using Posix Threads
Basic Multithreading using Posix Threads
 
Part 04 Creating a System Call in Linux
Part 04 Creating a System Call in LinuxPart 04 Creating a System Call in Linux
Part 04 Creating a System Call in Linux
 
Part 03 File System Implementation in Linux
Part 03 File System Implementation in LinuxPart 03 File System Implementation in Linux
Part 03 File System Implementation in Linux
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)
 
Open source applications softwares
Open source applications softwaresOpen source applications softwares
Open source applications softwares
 
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
Introduction to Ubuntu Edge Operating System (Ubuntu Touch)
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
Technical blog by Engineering Students of Sandip Foundation, itsitrc
Technical blog by Engineering Students of Sandip Foundation, itsitrcTechnical blog by Engineering Students of Sandip Foundation, itsitrc
Technical blog by Engineering Students of Sandip Foundation, itsitrc
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B Kute
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 

An imperative study of c

  • 1. Tushar B. Kute, Department of Information Technology, Sandip Institute of Technology and Research Centre, Nashik An Imperative Study of ‘C’
  • 2.
  • 4.
  • 5. Two views of program user interface software layers hidden by user interface user’s view programmer’s view
  • 6. Alphabets, Digits, Special Symbols. Constants, Variables, And Keywords Instructions Program. Forming a C program
  • 7. Compiling a C program
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. switch Statement Flow Chart
  • 17.
  • 18. while Loop while (continuation-condition) { // loop-body; }
  • 19. while Loop Flow Chart, cont. int i = 0; while (i < 100) { printf(&quot;Welcome to C!&quot;); i++; }
  • 20. do-while Loop do { // Loop body; } while (continue-condition);
  • 21. for Loop for (initialization; condition; increment/decrement) { //loop body; }
  • 22.
  • 23.
  • 25. The break Keyword
  • 26.
  • 27. The continue Keyword
  • 28.
  • 29. Arrays Array is a data structure that represents a collection of the same types of data. An Array of 10 Elements of type int
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62. Memory map for arrays a[i].roll a[i].name a[i].marks i 2 1 9 3 0 7 6 5 4 8 a[5].roll a[9].name
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69. Pointer Example int *p, x, y, *q = NULL; p = &x; *p = 4; p x (or *p) y 4 ? p = &y; p x y 4 ? *p is now another name for y q q . .
  • 70. *p = 8; p x y 4 8 q = p; p x y 4 8 q *p or *q q *p .
  • 71. p = &x; p x y 4 8 *q *p = *q; p x y 8 8 q *p q *p *q 8
  • 72.
  • 73. arrayOfPtr[0] = &k; arrayOfPtr[2]=&j; j k 6 4 arrayOfPtr ? 0 1 2 3 ?
  • 74.
  • 75.
  • 76.