SlideShare a Scribd company logo
Jagannath Institute of Management Sciences
Vasant Kunj-II, New Delhi - 110070
Subject Name: Programming In C
Department of Information Technology
Created By: Dr. Arpana Chaturvedi
@Dr. Arpana Chaturvedi
Subject: Programming In C
Topic: Unit II- Part I
Two Dimensional Arrays
@Dr. Arpana Chaturvedi
Topics to be Covered
▰ Two dimensional arrays
▰ Addition/Multiplication of two matrices
▰ Multiplication of two matrices
▰ Transpose of a square matrix
▰ Strings-Null terminated strings as array of characters
▰ Standard library string functions
Two dimensional Arrays in C
@Dr. Arpana Chaturvedi
Arrays of Array
@Dr. Arpana Chaturvedi
User View and memory View
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Storage Classes
@Dr. Arpana Chaturvedi
Storage Classes in C
Storage class specifiers in C language tells the compiler where to store a variable,
how to store the variable, what is the initial value of the variable and life time of the
variable.
SYNTAX:
▰ storage_specifier data_type variable _name;
TYPES OF STORAGE CLASS SPECIFIERS IN C:
▰ There are 4 storage class specifiers available in C language. They are,
▰ auto
▰ extern
▰ static
▰ register
@Dr. Arpana Chaturvedi
Types of Storage Specifiers in C
@Dr. Arpana Chaturvedi
Storage Specifier Description
auto
Storage place: CPU Memory
Initial/default value: Garbage value
Scope: local
Life: Within the function only.
extern
Storage place: CPU memory
Initial/default value: Zero
Scope: Global
Life: Till the end of the main program. Variable definition might be
anywhere in the C program.
static
Storage place: CPU memory
Initial/default value: Zero
Scope: local
Life: Retains the value of the variable between different function calls.
register
Storage place: Register memory
Initial/default value: Garbage value
Scope: local
Life: Within the function only.
Key Points to use Storage Specifiers in C
▰ For faster access of a variable, it is better to go for register specifiers rather than
auto specifiers.
▰ Because, register variables are stored in register memory whereas auto variables
are stored in main CPU memory.
▰ Only few variables can be stored in register memory. So, we can use variables as
register that are used very often in a C program.
@Dr. Arpana Chaturvedi
EXAMPLE PROGRAM FOR AUTO
VARIABLE IN C:
The scope of this auto variable is within the function only. It is
equivalent to local variable. All local variables are auto variables
by default.
@Dr. Arpana Chaturvedi
EXAMPLE PROGRAM FOR STATIC
VARIABLE IN C:
▰ Static variables retain the value of the variable between
different function calls.
@Dr. Arpana Chaturvedi
EXAMPLE PROGRAM FOR EXTERN
VARIABLE IN C:
▰ The scope of this extern variable is throughout the main
program. It is equivalent to global variable. Definition for
extern variable might be anywhere in the C program
@Dr. Arpana Chaturvedi
EXAMPLE PROGRAM FOR REGISTER
VARIABLE IN C:
▰ Register variables are also local variables, but stored in
register memory. Whereas, auto variables are stored in main
CPU memory.
▰ Register variables will be accessed very faster than the
normal variables since they are stored in register memory
rather than main memory.
▰ But, only limited variables can be used as register since
register size is very low. (16 bits, 32 bits or 64 bits)
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Data Types in C
@Dr. Arpana Chaturvedi
Decision Making Statements in C
@Dr. Arpana Chaturvedi
Dangling else in C
@Dr. Arpana Chaturvedi
Dangling else in C
@Dr. Arpana Chaturvedi
Dangling else in C
@Dr. Arpana Chaturvedi
Thank You !!

More Related Content

What's hot (20)

DOCX
Primitive data types
bad_zurbic
 
PDF
Introduction to Rstudio
Olga Scrivner
 
PPT
Unit 2 Principles of Programming Languages
Vasavi College of Engg
 
PDF
Run time storage
Rasineni Madhan Mohan Naidu
 
PPT
C presentation
APSMIND TECHNOLOGY PVT LTD.
 
PPT
Standard Library Functions
Praveen M Jigajinni
 
PDF
Sparql semantic information retrieval by
IJNSA Journal
 
PDF
Python Data Types
athithanvijay
 
PPT
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
sumitbardhan
 
PPT
Unit 5 cspc
BBDITM LUCKNOW
 
PDF
Introduction to c++ ppt
Prof. Dr. K. Adisesha
 
PDF
Lexyacc
unifesptk
 
PPTX
Yacc
BBDITM LUCKNOW
 
PPTX
ISI work
dgarijo
 
PPTX
Lex & yacc
Taha Malampatti
 
PPTX
Chapter 2.datatypes and operators
Jasleen Kaur (Chandigarh University)
 
PDF
Introduction to c++
Prof. Dr. K. Adisesha
 
PPT
Getting started with c++
K Durga Prasad
 
PDF
Python Programming - XII. File Processing
Ranel Padon
 
PPTX
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 1)
Binary Studio
 
Primitive data types
bad_zurbic
 
Introduction to Rstudio
Olga Scrivner
 
Unit 2 Principles of Programming Languages
Vasavi College of Engg
 
Run time storage
Rasineni Madhan Mohan Naidu
 
Standard Library Functions
Praveen M Jigajinni
 
Sparql semantic information retrieval by
IJNSA Journal
 
Python Data Types
athithanvijay
 
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
sumitbardhan
 
Unit 5 cspc
BBDITM LUCKNOW
 
Introduction to c++ ppt
Prof. Dr. K. Adisesha
 
Lexyacc
unifesptk
 
ISI work
dgarijo
 
Lex & yacc
Taha Malampatti
 
Chapter 2.datatypes and operators
Jasleen Kaur (Chandigarh University)
 
Introduction to c++
Prof. Dr. K. Adisesha
 
Getting started with c++
K Durga Prasad
 
Python Programming - XII. File Processing
Ranel Padon
 
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 1)
Binary Studio
 

Similar to Arrays 2 Dimensional Unit 2 Part 1.pdf (20)

PPTX
Storage class
Joy Forerver
 
PPT
cs8251 unit 1 ppt
praveenaprakasam
 
PPTX
Storage classes
UTTAM VERMA
 
DOCX
Storage class
Kalaikumar Thangapandi
 
PPTX
Storage Class in C Progrmming
Kamal Acharya
 
PPTX
Storage classes in c language
tanmaymodi4
 
PPTX
Storage classes in c language
Tanmay Modi
 
PPTX
Storage class in c
kash95
 
PDF
Advanced C Programming Notes
Leslie Schulte
 
PPT
Storage classes
Leela Koneru
 
DOC
5.program structure
Shankar Gangaju
 
PPTX
Storage classes in C
Nitesh Bichwani
 
PPT
Storage classes
Leela Koneru
 
PPTX
Storage classes
Puneet Rajput
 
PDF
Storage class
Kathmandu University
 
PPTX
Storage classes
priyanka jain
 
DOC
Storage classess of C progamming
Appili Vamsi Krishna
 
PDF
Latest C Interview Questions and Answers
DaisyWatson5
 
PPTX
Storage_classes_and_Scope_rules.pptx
CheriviralaNikhil
 
PPTX
C language presentation
bainspreet
 
Storage class
Joy Forerver
 
cs8251 unit 1 ppt
praveenaprakasam
 
Storage classes
UTTAM VERMA
 
Storage class
Kalaikumar Thangapandi
 
Storage Class in C Progrmming
Kamal Acharya
 
Storage classes in c language
tanmaymodi4
 
Storage classes in c language
Tanmay Modi
 
Storage class in c
kash95
 
Advanced C Programming Notes
Leslie Schulte
 
Storage classes
Leela Koneru
 
5.program structure
Shankar Gangaju
 
Storage classes in C
Nitesh Bichwani
 
Storage classes
Leela Koneru
 
Storage classes
Puneet Rajput
 
Storage class
Kathmandu University
 
Storage classes
priyanka jain
 
Storage classess of C progamming
Appili Vamsi Krishna
 
Latest C Interview Questions and Answers
DaisyWatson5
 
Storage_classes_and_Scope_rules.pptx
CheriviralaNikhil
 
C language presentation
bainspreet
 
Ad

More from Arpana Awasthi (9)

PDF
Unit 5 Part 1 Macros
Arpana Awasthi
 
PDF
Unit 2 Part 1.2 Data Types.pdf
Arpana Awasthi
 
PDF
Introduction To Python.pdf
Arpana Awasthi
 
PDF
Unit 2 Part 1 POLYMORPHISM.pdf
Arpana Awasthi
 
PDF
Unit 2 Part 1 Constructors.pdf
Arpana Awasthi
 
PDF
Eclipse - GUI Palette
Arpana Awasthi
 
PDF
Machine Learning: Need of Machine Learning, Its Challenges and its Applications
Arpana Awasthi
 
PDF
Programming language
Arpana Awasthi
 
PDF
Role of machine learning in detection, prevention and treatment of cancer
Arpana Awasthi
 
Unit 5 Part 1 Macros
Arpana Awasthi
 
Unit 2 Part 1.2 Data Types.pdf
Arpana Awasthi
 
Introduction To Python.pdf
Arpana Awasthi
 
Unit 2 Part 1 POLYMORPHISM.pdf
Arpana Awasthi
 
Unit 2 Part 1 Constructors.pdf
Arpana Awasthi
 
Eclipse - GUI Palette
Arpana Awasthi
 
Machine Learning: Need of Machine Learning, Its Challenges and its Applications
Arpana Awasthi
 
Programming language
Arpana Awasthi
 
Role of machine learning in detection, prevention and treatment of cancer
Arpana Awasthi
 
Ad

Recently uploaded (20)

PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PPTX
Wondershare Filmora Crack Free Download 2025
josanj305
 
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Wondershare Filmora Crack Free Download 2025
josanj305
 
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 

Arrays 2 Dimensional Unit 2 Part 1.pdf

  • 1. Jagannath Institute of Management Sciences Vasant Kunj-II, New Delhi - 110070 Subject Name: Programming In C Department of Information Technology Created By: Dr. Arpana Chaturvedi @Dr. Arpana Chaturvedi
  • 2. Subject: Programming In C Topic: Unit II- Part I Two Dimensional Arrays @Dr. Arpana Chaturvedi
  • 3. Topics to be Covered ▰ Two dimensional arrays ▰ Addition/Multiplication of two matrices ▰ Multiplication of two matrices ▰ Transpose of a square matrix ▰ Strings-Null terminated strings as array of characters ▰ Standard library string functions
  • 4. Two dimensional Arrays in C @Dr. Arpana Chaturvedi
  • 5. Arrays of Array @Dr. Arpana Chaturvedi
  • 6. User View and memory View @Dr. Arpana Chaturvedi
  • 7. Data Types in C @Dr. Arpana Chaturvedi
  • 8. Data Types in C @Dr. Arpana Chaturvedi
  • 9. Data Types in C @Dr. Arpana Chaturvedi
  • 10. Data Types in C @Dr. Arpana Chaturvedi
  • 11. Data Types in C @Dr. Arpana Chaturvedi
  • 12. Data Types in C @Dr. Arpana Chaturvedi
  • 13. Data Types in C @Dr. Arpana Chaturvedi
  • 14. Data Types in C @Dr. Arpana Chaturvedi
  • 15. Data Types in C @Dr. Arpana Chaturvedi
  • 16. Data Types in C @Dr. Arpana Chaturvedi
  • 17. Data Types in C @Dr. Arpana Chaturvedi
  • 18. Data Types in C @Dr. Arpana Chaturvedi
  • 20. Storage Classes in C Storage class specifiers in C language tells the compiler where to store a variable, how to store the variable, what is the initial value of the variable and life time of the variable. SYNTAX: ▰ storage_specifier data_type variable _name; TYPES OF STORAGE CLASS SPECIFIERS IN C: ▰ There are 4 storage class specifiers available in C language. They are, ▰ auto ▰ extern ▰ static ▰ register @Dr. Arpana Chaturvedi
  • 21. Types of Storage Specifiers in C @Dr. Arpana Chaturvedi Storage Specifier Description auto Storage place: CPU Memory Initial/default value: Garbage value Scope: local Life: Within the function only. extern Storage place: CPU memory Initial/default value: Zero Scope: Global Life: Till the end of the main program. Variable definition might be anywhere in the C program. static Storage place: CPU memory Initial/default value: Zero Scope: local Life: Retains the value of the variable between different function calls. register Storage place: Register memory Initial/default value: Garbage value Scope: local Life: Within the function only.
  • 22. Key Points to use Storage Specifiers in C ▰ For faster access of a variable, it is better to go for register specifiers rather than auto specifiers. ▰ Because, register variables are stored in register memory whereas auto variables are stored in main CPU memory. ▰ Only few variables can be stored in register memory. So, we can use variables as register that are used very often in a C program. @Dr. Arpana Chaturvedi
  • 23. EXAMPLE PROGRAM FOR AUTO VARIABLE IN C: The scope of this auto variable is within the function only. It is equivalent to local variable. All local variables are auto variables by default. @Dr. Arpana Chaturvedi
  • 24. EXAMPLE PROGRAM FOR STATIC VARIABLE IN C: ▰ Static variables retain the value of the variable between different function calls. @Dr. Arpana Chaturvedi
  • 25. EXAMPLE PROGRAM FOR EXTERN VARIABLE IN C: ▰ The scope of this extern variable is throughout the main program. It is equivalent to global variable. Definition for extern variable might be anywhere in the C program @Dr. Arpana Chaturvedi
  • 26. EXAMPLE PROGRAM FOR REGISTER VARIABLE IN C: ▰ Register variables are also local variables, but stored in register memory. Whereas, auto variables are stored in main CPU memory. ▰ Register variables will be accessed very faster than the normal variables since they are stored in register memory rather than main memory. ▰ But, only limited variables can be used as register since register size is very low. (16 bits, 32 bits or 64 bits) @Dr. Arpana Chaturvedi
  • 27. Data Types in C @Dr. Arpana Chaturvedi
  • 28. Data Types in C @Dr. Arpana Chaturvedi
  • 29. Decision Making Statements in C @Dr. Arpana Chaturvedi
  • 30. Dangling else in C @Dr. Arpana Chaturvedi
  • 31. Dangling else in C @Dr. Arpana Chaturvedi
  • 32. Dangling else in C @Dr. Arpana Chaturvedi