Login
Submit MCQs
Home
Computer Science
Application Software
Data Communications and Networks
Database Management System
Input and Output Devices
Introduction to Computers
Operating System and Utility Programs
Storage Devices
System Unit Components
G.K
Capital of Countries
Solar System
UN Organizations
Pak Study
Highways & Motorways
Islamic Studies
Ahadees
Holy Quran
Kalima
KPPSC
Assistant Engineer / SDO Civil 24-06-2023
Female SS Biology 24-05-23
Female SS Chemistry 25-05-23
Lecturer Computer Science 17-11-21
Lecturer Computer Science 23-05-23
Lecturer Computer Science 23-06-23
KP Board
Science - Class 6th
Science - Class 7th
Interviews
About
Contact
What are the differences between Local and Global Variable?
Local Variable:
Scope:
Local variables are declared within a specific block, function, or scope.
Lifetime:
They exist only within the block or function in which they are declared.
Access:
Accessible only within the block or function where they are defined.
Initialization:
This may not be initialized by default and must be explicitly assigned a value before use.
Memory Allocation:
Typically allocated on the stack.
Visibility:
Not visible or accessible outside the block or function where they are declared.
Global Variable:
Scope:
Global variables are declared outside of any function or block, making them accessible throughout the entire program.
Lifetime:
They exist for the entire duration of the program's execution.
Access:
Accessible from any part of the program, including functions and blocks.
Initialization:
May be initialized or uninitialized, and they retain their values between function calls.
Memory Allocation:
Typically allocated in the data segment of the program.
Visibility:
Visible and accessible from any part of the program.
MCQs Mode
Study Mode
Quiz Mode
MCQs Categories
1
Computer Science
143
2
English
3
3
Federal Government
35
4
General Knowledge
107
5
Islamic Studies
43
6
KP Boards
75
7
KPPSC
270
8
Pak Studies
33
9
SPSC
50
Top Contributors
Amir Iqbal
410 MCQ's
Safdar Ali
303 MCQ's
Jawad Bashir
46 MCQ's
Farhana
0 MCQ's
Jamroz Khan
0 MCQ's