1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Assoli18 [71]
3 years ago
13

Suppose a variable is passed By Value to a parameter of a Sub procedure, and the parameter has its value changed inside the Sub

procedure. What will the value of the variable be after the Sub procedure has executed?
Computers and Technology
1 answer:
algol [13]3 years ago
4 0

Answer:

"The value of the variable will remain the same which is already have when the sub-processor is called".

Explanation:

The above question said that:-

void fun(int a)

{

  a=a+1;

}

void main()

{

  int a=5;

  fun(a);

}

//what will be the value of a in the main function after the fun function is excuted.

  • Then the answer is: the value of a will be 5 in the main function.
  • It is because when the fun function is called, then a variable that is defined in the fun function is a local variable for fun function. That scope after the fun function is null.
  • The a variable inside the fun function is a different variable and the main function a variable is also a different variable.
  • So when the user prints the value of a variable inside the fun function, it will give the result as 6.
  • But when he prints the value of a variable inside the main function, then it will give the value as 5.
You might be interested in
The most commonly used video formats are the mpeg-____ format, the windows media audio/video format, and the audio visual interl
Archy [21]
<span>The answer is mpeg-4.  The most commonly used video formats are the mpeg-4 format, the windows media audio/video format, and the audio visual interleave format.</span>
8 0
3 years ago
Name any extension of MS word.
Svetradugi [14.3K]
Name any extension of MS word.

.doc
8 0
3 years ago
Read 2 more answers
How many generations of computer languages have there been since the middle of the 20th century?
evablogger [386]
4 generations hahahaha
3 0
3 years ago
Read 2 more answers
A certain computer has a 4meg address space. how many bits wide is this computer's address bus?
PIT_PIT [208]
22 bits






-----------------------------------
4 0
3 years ago
You are writing a program that defines a variable within a loop, and then tries to use that variable outside the loop. However,
Law Incorporation [45]

Answer:

The Variable is out of scope

Explanation:

In programming variables exists with scopes This could be local or global. When a variable is declared as a global variable it is available to all methods and procedures in the program. Java programming language as well as C++ and several others use the open and close braces to define the scope in programs. consider the following example

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>        int i = 0;</em>

<em>        while ( i<10){</em>

<em>            int sum = 0;</em>

<em>            sum = sum+i;       </em>

<em>        }</em>

<em>    }</em>

<em>}</em>

In this example, the variable i is global and can be assessed within the while loop but the variable sum is local to the while loop and cannot be assessed outside of it

4 0
3 years ago
Other questions:
  • A new company is upgrading a media workstation. The computer will be predominantly used for graphic intensive presentations, sli
    13·1 answer
  • Consider a multiprocessor CPU scheduling policy. There are 2 options: 1) a singlecommon ready queue of jobs; when a CPU becomes
    8·1 answer
  • Constraints are a. quantities to be minimized in a linear programming model. b. quantities to be maximized in a linear programmi
    5·1 answer
  • what is it called when someone uses software to run multiple operating systems on one computer at the same time? A.functional vi
    9·1 answer
  • Badin Industries runs a web application that processes e-commerce orders and handles credit card transactions. As such, it is su
    9·2 answers
  • 2.13) A simple rule to estimate your ideal body weight is to allow 110 pounds for the first 5 feet of height and 5 pounds for ea
    15·1 answer
  • The instructions for a computer program are sometimes referred to as . computer programmers focus on computer programs, but they
    5·2 answers
  • Which of the following accessories would you use to create a drawing? A. Calculator B. Notepad C. Paint D. WordPad
    14·2 answers
  • Which technique is best suited to create technical drawings?
    10·1 answer
  • If you were practicing keyboarding and the exercise contained the letters j, k, l, m, n, and b, what section of the
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!