SlideShare a Scribd company logo
Welcome
Md. Morshadun Nur
#13203016
BCSE
Array & Pointer
Conditional Logic , Looping,
Control string
Looping
• As we start Arrays & pointer that’s why we
have to know What is looping & how its
work.
• There are three types of looping
I. While(condition)
II. Do{body of the loop}
while(condition)
III. for(ini;test;inc/dec)
{statement}
Comparison of Three Loop
• for(n=1;n<=10;n++)
{
statement;
}
• n=1;
do{
statement;
n=n+1;
}
while(n<=10)
• n=1;
while(n<=10)
{
statement;
n=n+1;
}
Advantage of FOR Loop
• For loop in C has several compabilities
that are not found in other loop constructs.
• More than one variable can be initialized
at a time in for statement by comma
operator.
• Null statement for time delay
for(j=100;j<0;j--);
Example of for loop
• for(n=1,m=50;n<=m;n=n+1,m=m-1)
{
p=m/n;
printf(“%d%d%dn”,n,m,p);
}
• Sum=0;
for(i=1;i<20&&sum<100;++i)
{
sum=sum+1;…….
}
Infinitive Loop
• If the test condition is not present ,the for
loop sets up an infinitive loop.
• Here,
for(m=5;m++)
{
statement;
}
Nesting of for Loop
• Nesting of loops
That is one for
statement within
another for statement,
is allowed in C
language.
Selecting a Loop
• Pre-test loop or Post-test loop
• Post-test loop;(do….while)
• Pre-test loop;( for, while)
• Counter-based control;(for)
• Sentinel-based control;(while)
*All three control structure implemented on
counter and sentinel control based
system.
What is ARRAY
• To Display or Arrange in
a particular way
• Array is a similar type
variable
• Representing a list of
numbers or a list of
names
Types of ARRAY
• One dimensional Array
• Two dimensional Array
• Multidimensional Array
One Dimensional
How to Declare
Data type variable_name
[Size]
*Size=Declare the fixed
size of variable
Initialization Of One Dimensional
Array
At compile time
Data-type Array-
name[size]={a set of
value}
int
car[5]={21,24,45,67,43}
At Run time
• Int main()
{
sum[]={};
for(i=0;i<=10;i++)
{
if i<5
sum[i]=2;
else
sum[i]=5;
}
}
Two-Dimensional Array
How to declare
Data type Variable_name
[row_size][column_size]
*row_size=Number of row of
the table
*column_size=Number of
column of the table
Example
Multi-screen in front of a programmer
Memory layout
3*3 array
We can rearrange it in a
singular dimension by row-
major
10 20 30
40 50 60
70 80 90
10 20 30
40 50 60
70 80 90
Multidimensional Array
The elements of a 2*3*3
array
00
0
00
1
00
2
01
0
01
1
01
2
02
0
02
1
02
2
Here, the total element Is
18.
*As it is 3 dimensional
array that’s why every
position has three
reference
10
0
10
1
10
2
11
0
11
1
11
2
12
0
12
1
12
2
Multi-dimensional array
• C allows three or
more dimension
*Declaration of
dimension---
Data_type
variable_name
[x1][x2][x3]……[xn]
Example of multi-
dimension
int student [3] [4][5]
float mark_table
[5][4][5][3]
Here, student is a three-
dimensional
mark_table is four-
dimensional
Dynamic Array
• Normally we created
arrays at compile time
that can not be
modified and it is
known as static
memory allocation
• In which array that we
creates at run time as
users need that is
known as Dynamic
arrays.
Uses of Array
• Searching & Sorting
• Dynamic data structures
• Linked list
• Structures
• Passing arrays as function parameters
• Strings and character arrays
????
Thank You

More Related Content

What's hot

Functions
FunctionsFunctions
Dijkstra's algorithm
Dijkstra's algorithmDijkstra's algorithm
Dijkstra's algorithm
gsp1294
 
CRL 1.8 Functions
CRL 1.8 FunctionsCRL 1.8 Functions
CRL 1.8 Functions
A Jorge Garcia
 
pairs
pairspairs
pairs
Rajendran
 
Knowledge extraction from support vector machines
Knowledge extraction from support vector machinesKnowledge extraction from support vector machines
Knowledge extraction from support vector machines
Eyad Alshami
 
Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303
Namgee Lee
 
160511理論談話会
160511理論談話会160511理論談話会
160511理論談話会
Daisuke Yoshino
 
Multi prefix trie
Multi prefix trieMulti prefix trie
Multi prefix trie
mehdi sa
 
Study of-ndvi-land-surface-temperature-using-landsat-tm-data
Study of-ndvi-land-surface-temperature-using-landsat-tm-dataStudy of-ndvi-land-surface-temperature-using-landsat-tm-data
Study of-ndvi-land-surface-temperature-using-landsat-tm-data
José Pasapera Gonzales
 
1 5 graphs of functions
1 5 graphs of functions1 5 graphs of functions
1 5 graphs of functions
Alaina Wright
 
Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)
Shuvongkor Barman
 
Lecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesLecture 08 uninformed search techniques
Lecture 08 uninformed search techniques
Hema Kashyap
 
IOEfficientParalleMatrixMultiplication_present
IOEfficientParalleMatrixMultiplication_presentIOEfficientParalleMatrixMultiplication_present
IOEfficientParalleMatrixMultiplication_present
Shubham Joshi
 
Alg2 lesson 7-7
Alg2 lesson 7-7Alg2 lesson 7-7
Alg2 lesson 7-7
Carol Defreese
 
Alg2 lesson 7.7
Alg2 lesson 7.7Alg2 lesson 7.7
Alg2 lesson 7.7
Carol Defreese
 
Headerfiles
HeaderfilesHeaderfiles
Headerfiles
archikabhatia
 
Advanced Complex Analysis
Advanced Complex AnalysisAdvanced Complex Analysis
Advanced Complex Analysis
ambareen50
 
Strings1
Strings1Strings1
Strings1
Michael Gordon
 
Mid term solution
Mid term solutionMid term solution
Mid term solution
Gopi Saiteja
 
Bellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer NetworksBellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer Networks
SimranJain63
 

What's hot (20)

Functions
FunctionsFunctions
Functions
 
Dijkstra's algorithm
Dijkstra's algorithmDijkstra's algorithm
Dijkstra's algorithm
 
CRL 1.8 Functions
CRL 1.8 FunctionsCRL 1.8 Functions
CRL 1.8 Functions
 
pairs
pairspairs
pairs
 
Knowledge extraction from support vector machines
Knowledge extraction from support vector machinesKnowledge extraction from support vector machines
Knowledge extraction from support vector machines
 
Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303
 
160511理論談話会
160511理論談話会160511理論談話会
160511理論談話会
 
Multi prefix trie
Multi prefix trieMulti prefix trie
Multi prefix trie
 
Study of-ndvi-land-surface-temperature-using-landsat-tm-data
Study of-ndvi-land-surface-temperature-using-landsat-tm-dataStudy of-ndvi-land-surface-temperature-using-landsat-tm-data
Study of-ndvi-land-surface-temperature-using-landsat-tm-data
 
1 5 graphs of functions
1 5 graphs of functions1 5 graphs of functions
1 5 graphs of functions
 
Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)
 
Lecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesLecture 08 uninformed search techniques
Lecture 08 uninformed search techniques
 
IOEfficientParalleMatrixMultiplication_present
IOEfficientParalleMatrixMultiplication_presentIOEfficientParalleMatrixMultiplication_present
IOEfficientParalleMatrixMultiplication_present
 
Alg2 lesson 7-7
Alg2 lesson 7-7Alg2 lesson 7-7
Alg2 lesson 7-7
 
Alg2 lesson 7.7
Alg2 lesson 7.7Alg2 lesson 7.7
Alg2 lesson 7.7
 
Headerfiles
HeaderfilesHeaderfiles
Headerfiles
 
Advanced Complex Analysis
Advanced Complex AnalysisAdvanced Complex Analysis
Advanced Complex Analysis
 
Strings1
Strings1Strings1
Strings1
 
Mid term solution
Mid term solutionMid term solution
Mid term solution
 
Bellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer NetworksBellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer Networks
 

Viewers also liked

Mca ii dfs u-2 array records and pointer
Mca ii dfs u-2 array records and pointerMca ii dfs u-2 array records and pointer
Mca ii dfs u-2 array records and pointer
Rai University
 
structure,pointerandstring
structure,pointerandstringstructure,pointerandstring
Pointer
PointerPointer
Presentation on pointer.
Presentation on pointer.Presentation on pointer.
Presentation on pointer.
Md. Afif Al Mamun
 
C string
C stringC string
C pointer
C pointerC pointer
Unit 6 pointers
Unit 6   pointersUnit 6   pointers
Unit 6 pointers
George Erfesoglou
 

Viewers also liked (7)

Mca ii dfs u-2 array records and pointer
Mca ii dfs u-2 array records and pointerMca ii dfs u-2 array records and pointer
Mca ii dfs u-2 array records and pointer
 
structure,pointerandstring
structure,pointerandstringstructure,pointerandstring
structure,pointerandstring
 
Pointer
PointerPointer
Pointer
 
Presentation on pointer.
Presentation on pointer.Presentation on pointer.
Presentation on pointer.
 
C string
C stringC string
C string
 
C pointer
C pointerC pointer
C pointer
 
Unit 6 pointers
Unit 6   pointersUnit 6   pointers
Unit 6 pointers
 

Similar to Array&pointer

Java part 2
Java part  2Java part  2
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
Shubham Sharma
 
Arrays basics
Arrays basicsArrays basics
Arrays basics
sudhirvegad
 
6 arrays injava
6 arrays injava6 arrays injava
6 arrays injava
irdginfo
 
Lec2
Lec2Lec2
Lec2&3 data structure
Lec2&3 data structureLec2&3 data structure
Lec2&3 data structure
Ibrahim El-Torbany
 
LECTURE 3 LOOPS, ARRAYS.pdf
LECTURE 3 LOOPS, ARRAYS.pdfLECTURE 3 LOOPS, ARRAYS.pdf
LECTURE 3 LOOPS, ARRAYS.pdf
ShashikantSathe3
 
LECTURE 3 LOOPS, ARRAYS.pdf
LECTURE 3 LOOPS, ARRAYS.pdfLECTURE 3 LOOPS, ARRAYS.pdf
LECTURE 3 LOOPS, ARRAYS.pdf
SHASHIKANT346021
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
Abhilash Nair
 
C# Arrays
C# ArraysC# Arrays
C# Arrays
Hock Leng PUAH
 
Lec2&3_DataStructure
Lec2&3_DataStructureLec2&3_DataStructure
Lec2&3_DataStructure
Ibrahim El-Torbany
 
Lec2&3 data structure
Lec2&3 data structureLec2&3 data structure
Lec2&3 data structure
Saad Gabr
 
Lec2
Lec2Lec2
Lec2
Saad Gabr
 
Array
ArrayArray
Chap 6 c++
Chap 6 c++Chap 6 c++
Chap 6 c++
Chap 6 c++Chap 6 c++
Visual Programing basic lectures 7.pptx
Visual Programing basic lectures  7.pptxVisual Programing basic lectures  7.pptx
Visual Programing basic lectures 7.pptx
Mrhaider4
 
Abir ppt3
Abir ppt3Abir ppt3
Abir ppt3
abir96
 
spfchapter8arrays-100519221515-phpapp01.pdf
spfchapter8arrays-100519221515-phpapp01.pdfspfchapter8arrays-100519221515-phpapp01.pdf
spfchapter8arrays-100519221515-phpapp01.pdf
pepe3059
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
Aiman Hud
 

Similar to Array&pointer (20)

Java part 2
Java part  2Java part  2
Java part 2
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
Arrays basics
Arrays basicsArrays basics
Arrays basics
 
6 arrays injava
6 arrays injava6 arrays injava
6 arrays injava
 
Lec2
Lec2Lec2
Lec2
 
Lec2&3 data structure
Lec2&3 data structureLec2&3 data structure
Lec2&3 data structure
 
LECTURE 3 LOOPS, ARRAYS.pdf
LECTURE 3 LOOPS, ARRAYS.pdfLECTURE 3 LOOPS, ARRAYS.pdf
LECTURE 3 LOOPS, ARRAYS.pdf
 
LECTURE 3 LOOPS, ARRAYS.pdf
LECTURE 3 LOOPS, ARRAYS.pdfLECTURE 3 LOOPS, ARRAYS.pdf
LECTURE 3 LOOPS, ARRAYS.pdf
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
C# Arrays
C# ArraysC# Arrays
C# Arrays
 
Lec2&3_DataStructure
Lec2&3_DataStructureLec2&3_DataStructure
Lec2&3_DataStructure
 
Lec2&3 data structure
Lec2&3 data structureLec2&3 data structure
Lec2&3 data structure
 
Lec2
Lec2Lec2
Lec2
 
Array
ArrayArray
Array
 
Chap 6 c++
Chap 6 c++Chap 6 c++
Chap 6 c++
 
Chap 6 c++
Chap 6 c++Chap 6 c++
Chap 6 c++
 
Visual Programing basic lectures 7.pptx
Visual Programing basic lectures  7.pptxVisual Programing basic lectures  7.pptx
Visual Programing basic lectures 7.pptx
 
Abir ppt3
Abir ppt3Abir ppt3
Abir ppt3
 
spfchapter8arrays-100519221515-phpapp01.pdf
spfchapter8arrays-100519221515-phpapp01.pdfspfchapter8arrays-100519221515-phpapp01.pdf
spfchapter8arrays-100519221515-phpapp01.pdf
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 

Recently uploaded

Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
IsmaelVazquez38
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
Celine George
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
Kalna College
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
shreyassri1208
 
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxxSimple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
RandolphRadicy
 

Recently uploaded (20)

Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
 
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxxSimple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
 

Array&pointer

  • 3.
  • 4.
  • 5.
  • 6. Array & Pointer Conditional Logic , Looping, Control string
  • 7. Looping • As we start Arrays & pointer that’s why we have to know What is looping & how its work. • There are three types of looping I. While(condition) II. Do{body of the loop} while(condition) III. for(ini;test;inc/dec) {statement}
  • 8. Comparison of Three Loop • for(n=1;n<=10;n++) { statement; } • n=1; do{ statement; n=n+1; } while(n<=10) • n=1; while(n<=10) { statement; n=n+1; }
  • 9. Advantage of FOR Loop • For loop in C has several compabilities that are not found in other loop constructs. • More than one variable can be initialized at a time in for statement by comma operator. • Null statement for time delay for(j=100;j<0;j--);
  • 10. Example of for loop • for(n=1,m=50;n<=m;n=n+1,m=m-1) { p=m/n; printf(“%d%d%dn”,n,m,p); } • Sum=0; for(i=1;i<20&&sum<100;++i) { sum=sum+1;……. }
  • 11. Infinitive Loop • If the test condition is not present ,the for loop sets up an infinitive loop. • Here, for(m=5;m++) { statement; }
  • 12. Nesting of for Loop • Nesting of loops That is one for statement within another for statement, is allowed in C language.
  • 13. Selecting a Loop • Pre-test loop or Post-test loop • Post-test loop;(do….while) • Pre-test loop;( for, while) • Counter-based control;(for) • Sentinel-based control;(while) *All three control structure implemented on counter and sentinel control based system.
  • 14. What is ARRAY • To Display or Arrange in a particular way • Array is a similar type variable • Representing a list of numbers or a list of names
  • 15. Types of ARRAY • One dimensional Array • Two dimensional Array • Multidimensional Array
  • 16. One Dimensional How to Declare Data type variable_name [Size] *Size=Declare the fixed size of variable
  • 17. Initialization Of One Dimensional Array At compile time Data-type Array- name[size]={a set of value} int car[5]={21,24,45,67,43} At Run time • Int main() { sum[]={}; for(i=0;i<=10;i++) { if i<5 sum[i]=2; else sum[i]=5; } }
  • 18. Two-Dimensional Array How to declare Data type Variable_name [row_size][column_size] *row_size=Number of row of the table *column_size=Number of column of the table Example
  • 19. Multi-screen in front of a programmer
  • 20. Memory layout 3*3 array We can rearrange it in a singular dimension by row- major 10 20 30 40 50 60 70 80 90 10 20 30 40 50 60 70 80 90
  • 21. Multidimensional Array The elements of a 2*3*3 array 00 0 00 1 00 2 01 0 01 1 01 2 02 0 02 1 02 2 Here, the total element Is 18. *As it is 3 dimensional array that’s why every position has three reference 10 0 10 1 10 2 11 0 11 1 11 2 12 0 12 1 12 2
  • 22. Multi-dimensional array • C allows three or more dimension *Declaration of dimension--- Data_type variable_name [x1][x2][x3]……[xn] Example of multi- dimension int student [3] [4][5] float mark_table [5][4][5][3] Here, student is a three- dimensional mark_table is four- dimensional
  • 23. Dynamic Array • Normally we created arrays at compile time that can not be modified and it is known as static memory allocation • In which array that we creates at run time as users need that is known as Dynamic arrays.
  • 24. Uses of Array • Searching & Sorting • Dynamic data structures • Linked list • Structures • Passing arrays as function parameters • Strings and character arrays
  • 25. ????