SlideShare a Scribd company logo
Scope of variables
Disclaimer: This presentation is prepared by 
trainees of baabtra as a part of mentoring 
program. This is not official document of baabtra – 
Mentoring Partner 
Baabtra-Mentoring Partner is the mentoring division of baabte System 
Technologies Pvt . Ltd
Syed Maharoof thangal c 
mahroof917@@gmail.com 
www.facebook.com/syed mahroof 
twitter.com/syed mahroof 
in.linkedin.com/in/syed mahroof
 A variable is nothing but a name given to a 
storage area that our program can 
manipulate. 
 Each variable in C has a specific type, 
◦ Size and layout 
◦ Range 
◦ Set of operations
 Char 
 Int 
 Flaot 
 Double 
 void
 An objective C program will consist of code 
divided up into functions, classes , and code 
structures 
 A typical program will make extensive use of 
variable to store and manipulate data 
 Once a variable declared it may or may not be 
accessible to other section of program code 
 This accessibility depends on where and how the 
variable was declared and where the code is that 
needed to access .This is known as variable 
scope
 Local Variables 
 Global variables
 Variable that are declared inside a function or 
block called local variables 
 They can be used only by statements that are 
inside that function or block of code 
 Local variable not known to functions outside
 Here all the variables x , y and z are declared 
inside the main , so it is local to main() 
functions
 Global variables are defined outside of a 
function , usually on top of the program 
 The global variables will hold their value 
throughout the lifetime of your program and 
they can be accessed inside any functions 
defined for the program 
 A global variable can be accessed by any 
function 
 Global variable is available for use throughout 
your entire program after its declaration
Scope of variables
 A program can have same name for local and 
global variables 
 But value of local variables inside a function 
will take preference
Scope of variables
Want to learn more about programming or Looking to become a good programmer? 
Are you wasting time on searching so many contents online? 
Do you want to learn things quickly? 
Tired of spending huge amount of money to become a Software professional? 
Do an online course 
@ baabtra.com 
We put industry standards to practice. Our structured, activity based courses are so designed 
to make a quick, good software professional out of anybody who holds a passion for coding.
Follow us @ twitter.com/baabtra 
Like us @ facebook.com/baabtra 
Subscribe to us @ youtube.com/baabtra 
Become a follower @ slideshare.net/BaabtraMentoringPartner 
Connect to us @ in.linkedin.com/in/baabtra 
Thanks in advance. 
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us 
Emarald Mall (Big Bazar Building) 
Mavoor Road, Kozhikode, 
Kerala, India. 
Ph: + 91 – 495 40 25 550 
NC Complex, Near Bus Stand 
Mukkam, Kozhikode, 
Kerala, India. 
Ph: + 91 – 495 40 25 550 
Cafit Square, 
Hilite Business Park, 
Near Pantheerankavu, 
Kozhikode 
Start up Village 
Eranakulam, 
Kerala, India. 
Email: info@baabtra.com

More Related Content

PPTX
Java package
PPT
C++ Memory Management
PPTX
Encapsulation C++
PPTX
Static Data Members and Member Functions
PPTX
data abstraction in DBMS
PDF
loaders and linkers
PDF
C++ OOPS Concept
PPT
Function overloading(c++)
Java package
C++ Memory Management
Encapsulation C++
Static Data Members and Member Functions
data abstraction in DBMS
loaders and linkers
C++ OOPS Concept
Function overloading(c++)

What's hot (20)

PPTX
5. stored procedure and functions
PPT
Unit 3 object analysis-classification
PPTX
java interface and packages
PPT
13. Query Processing in DBMS
PPTX
Inheritance in java
PPTX
Static Members-Java.pptx
PPTX
OPERATOR OVERLOADING IN C++
PPTX
OOPS In JAVA.pptx
PDF
Explain Communication among agents in Artificial Intelligence
PDF
Class and Objects in Java
PDF
Oops concepts || Object Oriented Programming Concepts in Java
PPTX
[OOP - Lec 08] Encapsulation (Information Hiding)
PPTX
Encapsulation
PPT
Class and object in C++
PDF
Syntax Directed Definition and its applications
DOC
Time and space complexity
PPTX
JAVA AWT
PPTX
Inheritance in c++
PPTX
Java packages
5. stored procedure and functions
Unit 3 object analysis-classification
java interface and packages
13. Query Processing in DBMS
Inheritance in java
Static Members-Java.pptx
OPERATOR OVERLOADING IN C++
OOPS In JAVA.pptx
Explain Communication among agents in Artificial Intelligence
Class and Objects in Java
Oops concepts || Object Oriented Programming Concepts in Java
[OOP - Lec 08] Encapsulation (Information Hiding)
Encapsulation
Class and object in C++
Syntax Directed Definition and its applications
Time and space complexity
JAVA AWT
Inheritance in c++
Java packages
Ad

Viewers also liked (6)

PPT
Enumerated data types in C
PPTX
C if else
PPT
C Structures And Unions
PPTX
CONDITIONAL STATEMENT IN C LANGUAGE
PPTX
Storage class in C Language
Enumerated data types in C
C if else
C Structures And Unions
CONDITIONAL STATEMENT IN C LANGUAGE
Storage class in C Language
Ad

Similar to Scope of variables (20)

PPTX
LOCAL VARIABLES AND GLOBAL VARIABLES.pptx
PPTX
Variable Scopes
PDF
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
PDF
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
PDF
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
PPTX
Variable Scope
PDF
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
PDF
Data structure scope of variables
PDF
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
PDF
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
PPTX
Function Returns
PDF
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
PDF
Gnu octave help book 02 of 02
LOCAL VARIABLES AND GLOBAL VARIABLES.pptx
Variable Scopes
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
Variable Scope
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
Data structure scope of variables
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis S...
Function Returns
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
Gnu octave help book 02 of 02

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Cloud computing and distributed systems.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Modernizing your data center with Dell and AMD
PPT
Teaching material agriculture food technology
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Cloud computing and distributed systems.
Chapter 3 Spatial Domain Image Processing.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation_ Review paper, used for researhc scholars
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Modernizing your data center with Dell and AMD
Teaching material agriculture food technology
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Scope of variables

  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra – Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3. Syed Maharoof thangal c mahroof917@@gmail.com www.facebook.com/syed mahroof twitter.com/syed mahroof in.linkedin.com/in/syed mahroof
  • 4.  A variable is nothing but a name given to a storage area that our program can manipulate.  Each variable in C has a specific type, ◦ Size and layout ◦ Range ◦ Set of operations
  • 5.  Char  Int  Flaot  Double  void
  • 6.  An objective C program will consist of code divided up into functions, classes , and code structures  A typical program will make extensive use of variable to store and manipulate data  Once a variable declared it may or may not be accessible to other section of program code  This accessibility depends on where and how the variable was declared and where the code is that needed to access .This is known as variable scope
  • 7.  Local Variables  Global variables
  • 8.  Variable that are declared inside a function or block called local variables  They can be used only by statements that are inside that function or block of code  Local variable not known to functions outside
  • 9.  Here all the variables x , y and z are declared inside the main , so it is local to main() functions
  • 10.  Global variables are defined outside of a function , usually on top of the program  The global variables will hold their value throughout the lifetime of your program and they can be accessed inside any functions defined for the program  A global variable can be accessed by any function  Global variable is available for use throughout your entire program after its declaration
  • 12.  A program can have same name for local and global variables  But value of local variables inside a function will take preference
  • 14. Want to learn more about programming or Looking to become a good programmer? Are you wasting time on searching so many contents online? Do you want to learn things quickly? Tired of spending huge amount of money to become a Software professional? Do an online course @ baabtra.com We put industry standards to practice. Our structured, activity based courses are so designed to make a quick, good software professional out of anybody who holds a passion for coding.
  • 15. Follow us @ twitter.com/baabtra Like us @ facebook.com/baabtra Subscribe to us @ youtube.com/baabtra Become a follower @ slideshare.net/BaabtraMentoringPartner Connect to us @ in.linkedin.com/in/baabtra Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 16. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Cafit Square, Hilite Business Park, Near Pantheerankavu, Kozhikode Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com