SlideShare a Scribd company logo
1 of 4
Presentation by
“Nayyab Mir”
Topic name:
“Scope rule”
Definition of “Scope Rule”
• The scope rules of a language decides in which part(s) of the program
a particular piece of code on data in item can be accessed
Basic four scope rules:
1. File scope
2. Block scope
3. Function prototype scope
4. Function scope
• File scope: “ These Variable s are usually declare outside of all functions
and blocks at the top of program. They are also called global scope
variable.”
• Block scope: “A block scope is a set of statement enclosed within left and
right braces i.e. A variable declare d inside a block is accessible in the inner
block but not accessible outside the block i.e.only accessible to the block in
which variables are defined”
• Function prototype: “In these the scope of variables begin right after the
declaration in function parameter list and run to the and the declaration
list”
• Function scope: “A function scope begins at the opening of function and
end with the closing of it.
A function scope is applicable to the label only. A label declared is use as a
Target to goto statement and both goto and label statement must be in a
same function.
scope rules.pptx

More Related Content

Similar to scope rules.pptx

Storage Class Specifiers
Storage Class SpecifiersStorage Class Specifiers
Storage Class SpecifiersReddhi Basu
 
Storage Class Specifiers in C++
Storage Class Specifiers in C++Storage Class Specifiers in C++
Storage Class Specifiers in C++Reddhi Basu
 
The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210Mahmoud Samir Fayed
 
java tutorial for beginners learning.ppt
java tutorial for beginners learning.pptjava tutorial for beginners learning.ppt
java tutorial for beginners learning.pptusha852
 
Operator Overloading and Scope of Variable
Operator Overloading and Scope of VariableOperator Overloading and Scope of Variable
Operator Overloading and Scope of VariableMOHIT DADU
 
The Ring programming language version 1.8 book - Part 81 of 202
The Ring programming language version 1.8 book - Part 81 of 202The Ring programming language version 1.8 book - Part 81 of 202
The Ring programming language version 1.8 book - Part 81 of 202Mahmoud Samir Fayed
 
UNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csUNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csjaved75
 
EEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answerEEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answerJeba Moses
 
Chap1 packages
Chap1 packagesChap1 packages
Chap1 packagesraksharao
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using ReflectionGanesh Samarthyam
 
Refactoring_Rosenheim_2008_Workshop
Refactoring_Rosenheim_2008_WorkshopRefactoring_Rosenheim_2008_Workshop
Refactoring_Rosenheim_2008_WorkshopMax Kleiner
 
Skillwise - Cobol Programming Basics
Skillwise - Cobol Programming BasicsSkillwise - Cobol Programming Basics
Skillwise - Cobol Programming BasicsSkillwise Group
 
Basic construction of c
Basic construction of cBasic construction of c
Basic construction of ckinish kumar
 

Similar to scope rules.pptx (20)

Variable scope in php
Variable scope in phpVariable scope in php
Variable scope in php
 
Storage Class Specifiers
Storage Class SpecifiersStorage Class Specifiers
Storage Class Specifiers
 
Storage Class Specifiers in C++
Storage Class Specifiers in C++Storage Class Specifiers in C++
Storage Class Specifiers in C++
 
10. sub program
10. sub program10. sub program
10. sub program
 
The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210
 
java tutorial for beginners learning.ppt
java tutorial for beginners learning.pptjava tutorial for beginners learning.ppt
java tutorial for beginners learning.ppt
 
01 Variables
01 Variables01 Variables
01 Variables
 
Operator Overloading and Scope of Variable
Operator Overloading and Scope of VariableOperator Overloading and Scope of Variable
Operator Overloading and Scope of Variable
 
The Ring programming language version 1.8 book - Part 81 of 202
The Ring programming language version 1.8 book - Part 81 of 202The Ring programming language version 1.8 book - Part 81 of 202
The Ring programming language version 1.8 book - Part 81 of 202
 
UNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csUNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year cs
 
EEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answerEEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answer
 
Chap1 packages
Chap1 packagesChap1 packages
Chap1 packages
 
Storage classes
Storage classesStorage classes
Storage classes
 
Js scope
Js scopeJs scope
Js scope
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using Reflection
 
Refactoring_Rosenheim_2008_Workshop
Refactoring_Rosenheim_2008_WorkshopRefactoring_Rosenheim_2008_Workshop
Refactoring_Rosenheim_2008_Workshop
 
Coding
CodingCoding
Coding
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Skillwise - Cobol Programming Basics
Skillwise - Cobol Programming BasicsSkillwise - Cobol Programming Basics
Skillwise - Cobol Programming Basics
 
Basic construction of c
Basic construction of cBasic construction of c
Basic construction of c
 

More from NayyabMirTahir

HR Strategy and work force diversity.pptx
HR Strategy and work force diversity.pptxHR Strategy and work force diversity.pptx
HR Strategy and work force diversity.pptxNayyabMirTahir
 
Group 5 HRM PRESENTATION.pptx
Group 5 HRM PRESENTATION.pptxGroup 5 HRM PRESENTATION.pptx
Group 5 HRM PRESENTATION.pptxNayyabMirTahir
 
Sources of recruitment.pptx
Sources of recruitment.pptxSources of recruitment.pptx
Sources of recruitment.pptxNayyabMirTahir
 
Past Papers (Compiler Construction).pdf
Past Papers (Compiler Construction).pdfPast Papers (Compiler Construction).pdf
Past Papers (Compiler Construction).pdfNayyabMirTahir
 
Organizational Structure, do's and dont's.ppt
Organizational Structure, do's and dont's.pptOrganizational Structure, do's and dont's.ppt
Organizational Structure, do's and dont's.pptNayyabMirTahir
 
Nayyab Mir 1922110025.pdf
Nayyab Mir 1922110025.pdfNayyab Mir 1922110025.pdf
Nayyab Mir 1922110025.pdfNayyabMirTahir
 
computing standards.pdf
computing standards.pdfcomputing standards.pdf
computing standards.pdfNayyabMirTahir
 
Statement of Cash Flows - CR.pdf
Statement of Cash Flows - CR.pdfStatement of Cash Flows - CR.pdf
Statement of Cash Flows - CR.pdfNayyabMirTahir
 
OOAD t1 short questions.pdf
OOAD t1 short questions.pdfOOAD t1 short questions.pdf
OOAD t1 short questions.pdfNayyabMirTahir
 
past papers solved.pdf
past papers solved.pdfpast papers solved.pdf
past papers solved.pdfNayyabMirTahir
 
income statement and journal .pdf
income statement and journal .pdfincome statement and journal .pdf
income statement and journal .pdfNayyabMirTahir
 

More from NayyabMirTahir (20)

HR Strategy and work force diversity.pptx
HR Strategy and work force diversity.pptxHR Strategy and work force diversity.pptx
HR Strategy and work force diversity.pptx
 
Group 5 HRM PRESENTATION.pptx
Group 5 HRM PRESENTATION.pptxGroup 5 HRM PRESENTATION.pptx
Group 5 HRM PRESENTATION.pptx
 
ch1-1.ppt
ch1-1.pptch1-1.ppt
ch1-1.ppt
 
group 4 week 7.pptx
group 4 week 7.pptxgroup 4 week 7.pptx
group 4 week 7.pptx
 
Sources of recruitment.pptx
Sources of recruitment.pptxSources of recruitment.pptx
Sources of recruitment.pptx
 
Past Papers (Compiler Construction).pdf
Past Papers (Compiler Construction).pdfPast Papers (Compiler Construction).pdf
Past Papers (Compiler Construction).pdf
 
Nayyab Mir 25.docx
Nayyab Mir 25.docxNayyab Mir 25.docx
Nayyab Mir 25.docx
 
Organizational Structure, do's and dont's.ppt
Organizational Structure, do's and dont's.pptOrganizational Structure, do's and dont's.ppt
Organizational Structure, do's and dont's.ppt
 
group..4 (1).pptx
group..4 (1).pptxgroup..4 (1).pptx
group..4 (1).pptx
 
MPI.pptx
MPI.pptxMPI.pptx
MPI.pptx
 
Nayyab Mir 1922110025.pdf
Nayyab Mir 1922110025.pdfNayyab Mir 1922110025.pdf
Nayyab Mir 1922110025.pdf
 
computing standards.pdf
computing standards.pdfcomputing standards.pdf
computing standards.pdf
 
Statement of Cash Flows - CR.pdf
Statement of Cash Flows - CR.pdfStatement of Cash Flows - CR.pdf
Statement of Cash Flows - CR.pdf
 
Spatial filters.pdf
Spatial filters.pdfSpatial filters.pdf
Spatial filters.pdf
 
OOAD t1 short questions.pdf
OOAD t1 short questions.pdfOOAD t1 short questions.pdf
OOAD t1 short questions.pdf
 
AI week 2.pdf
AI week 2.pdfAI week 2.pdf
AI week 2.pdf
 
past papers solved.pdf
past papers solved.pdfpast papers solved.pdf
past papers solved.pdf
 
Lecture 1 FA.docx
Lecture 1 FA.docxLecture 1 FA.docx
Lecture 1 FA.docx
 
income statement and journal .pdf
income statement and journal .pdfincome statement and journal .pdf
income statement and journal .pdf
 
accrual examples .pdf
accrual examples .pdfaccrual examples .pdf
accrual examples .pdf
 

Recently uploaded

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

scope rules.pptx

  • 1. Presentation by “Nayyab Mir” Topic name: “Scope rule”
  • 2. Definition of “Scope Rule” • The scope rules of a language decides in which part(s) of the program a particular piece of code on data in item can be accessed Basic four scope rules: 1. File scope 2. Block scope 3. Function prototype scope 4. Function scope
  • 3. • File scope: “ These Variable s are usually declare outside of all functions and blocks at the top of program. They are also called global scope variable.” • Block scope: “A block scope is a set of statement enclosed within left and right braces i.e. A variable declare d inside a block is accessible in the inner block but not accessible outside the block i.e.only accessible to the block in which variables are defined” • Function prototype: “In these the scope of variables begin right after the declaration in function parameter list and run to the and the declaration list” • Function scope: “A function scope begins at the opening of function and end with the closing of it. A function scope is applicable to the label only. A label declared is use as a Target to goto statement and both goto and label statement must be in a same function.