Which of the following statements is accurate about variable scope? - ProProfs Discuss
Cancel
TopicsDown
Products Down
Follow Us:
FacebookTwitter
Advertisement

Which of the following statements is accurate about variable scope?

Which of the following statements is accurate about variable scope?

Change Image    Delete



A. Sub-blocks cannot reuse a parent block s variable name
B. Parallel blocks can use the same variable name
C. A variable can be defined at any point in a block
D. A static variable can restrict the scope to the current block if its values is null
E. Sub-blocks can reuse a parent´s block variable name if its value is null

This question is part of Platform Dev 1
Asked by Raviteja, Last updated: Sep 22, 2020

+ Answer
Request
Question menu
Vote up Vote down

3 Answers

John Smith

John Smith

John Smith
John Smith

Answered Oct 25, 2016

1. Sub-blocks cannot reuse a parent block s variable name.
2. Parallel blocks can use the same variable name.
3. A variable can be defined at any point in a block.

upvote 1 downvote
Reply 

f.Brian

f.Brian

f.Brian
F.Brian

Answered Jan 28, 2018

Variable scopes are related to C++ programming. There are three different places within a program where variable scopes can be declared. These three places include inside a function or block which is called local variables, in the definition of function parameters or formal parameters, or outside of all functions which is called global variables.

A few accurate statements about variable scopes would be that sub-blocks cannot reuse a parent block’s variable name, parallel blocks can use the same variable name, and a variable can be defined at any point in a block.

upvote downvote
Reply 

John Adney

John Adney

John Adney
John Adney

Answered Mar 23, 2017

In option 1 do you mean reuse as redeclare? then this choice is correct.
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.