FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Complete this sentence:Variables and constants declared inside a sub-routine using ____ keyword are accessible throughout the program.
A
local
B
global
C
Both A and B
D
None of the above
Explanation: 

Detailed explanation-1: -Global Variables A Global variable is one that can be accessed from anywhere in your program. We try to prefix all Global variables with “G". Global variables are generally declared at the top (ie: Declarations section) of a module.

Detailed explanation-2: -Variables defined inside functions are called local variables. Their value can only be used within the function where they are declared.

Detailed explanation-3: -Local variables are initiated within a limited scope, this means they are declared when a function or subroutine is called, and once the function ends, the memory taken up by the variable is released. This contrasts with global variables which do not release memory.

There is 1 question to complete.