A variable declared inside a function is called a:
A
Global variable
B
Local variable
Correct answer
C
Constant
D
Static variable
Correct answer
B. Local variable
10 views
⚔️
Challenge a friend on Computer Science FBISE Class 10
Same MCQs, timed, live leaderboard. Send the link on WhatsApp – no sign-up needed.
Create challenge
Explanation
Local variables are declared inside a function and can only be used there. Global variables are declared outside and are accessible throughout the program. Scope determines where a variable is visible.
Reference
Asked in: Matric,FBISE
Doubts & discussionNot sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ
‹ Previous MCQ What is the output of the following code? int x = 5; printf("%d", x++); Next MCQ › Which of these data types stores a single character in C?