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
Fed [463]
4 years ago
5

When an argument is passed to a method:A) its value is copied into the method's parameter variableB) its value may be changed wi

thin the called methodC) values may not be passed to methodsD) the method must not assign another value to the parameter that receives the argument
Computers and Technology
1 answer:
Dmitry_Shevchenko [17]4 years ago
8 0

Answer:

The correct answer for the given question is option(A) i.e its value is copied into the method's parameter variable.

Explanation:

Following are the points regarding that.

1.In function calling when we use call by value the actual argument is passed to the formal argument .

2.The actual argument are those which is present in the calling portion of the program.

3.The formal parameter are those which is present in method signature.

4.It means that The value of actual argument is copy into the formal argument i.e method's parameter.

5.Let us consider an example

    Following are the code in C++

#include<iostream>// header file

using namespace std;

void sum(int,int);

int main() // main function

{

int a=90,b=9; // variable declaration

sum(a,b);//here a and b are actual parameter calling function sum

return 0;

}

void sum(int p,int q) // function definition

{

cout<<" the sum  is :"<<p+q; // add

}

In this program the actual parameter is a and b and method parameter is p and q respectively.

The variable  a "actual parameter" is copies the value in  variable p "formal parameter".Similarly the variable  b  "actual parameter"  is copies the value in  variable p "formal parameter".So changes made in formal parameter does not reflected back to actual parameter this is call by value which copies the value of actual parameter to method parameter.

output:99

Therefore The correct option is(A).

You might be interested in
Which directive is used when defining 64-bit IEEE long reals?
Taya2010 [7]

Answer:

The answer is "Option b".

Explanation:

In the project of IEEE-754 to define 64 -bit we require a REAL8 double precision that is equal to 8 bytes and 64 bit, and it is also used for floating-point arithmetic, and other options were not correct that can be described as follows:

  • In option a, REAL4 is used to define 32-bit, that's why it is not correct.
  • In option c, This type of declaration is not valid in IEEE, that's why it is wrong.
  • In option d, The REAL is a keyword that is used to define a value but in this, there is no value to define, that's why it is wrong.

7 0
3 years ago
Client/server networks are controlled by a central server that runs a specialized piece of software called
Marta_Voda [28]
It is called a wired hot spot

6 0
4 years ago
How do i open screenshots on school chromebook?
yuradex [85]

Answer:

you have to open your file explorer and open the screenshot folder.

Explanation:

3 0
2 years ago
Read 2 more answers
In which country did the World Cyber Games originate?
levacccp [35]
The world cyber games originated in South Korea.
8 0
4 years ago
Read 2 more answers
Which protocol that runs on cisco routers shares information between cisco devices?
just olya [345]
The CDP protocol runs on CISCO routers and shares information between CISCO devices. CDP stands for Cisco Discovery Protocol. It is a protocol on Layer 2 (Data -Link layer) of the OSI model that enables CISCO devices to share information between them. The information includes for example the <span>operating system version and IP address.</span>
6 0
3 years ago
Other questions:
  • If you're able to understand directions more easily when you hear them instead of reading them you are most likely
    12·1 answer
  • Identify which statement explains why a programmer would break a logic problem into steps.
    13·2 answers
  • Write a python program that asks the user to enter a student's name and 8 numeric tests scores (out of 100 for each test). The n
    5·1 answer
  • A small group of travelers is meeting inside an ancient building, and the travelers need access to the Internet using their mobi
    11·1 answer
  • Ben is writing a paper for his college history class, and he wants to include some information he found on a Web site. What are
    5·1 answer
  • What is the output of the following code<br> X = 06<br> y = 0<br> print (x ** y)
    12·1 answer
  • Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin
    6·1 answer
  • Complete the AscendingAndDescending application so that it asks a user to enter three integers. Display them in ascending and de
    7·1 answer
  • What are the benefits and drawbacks of a desktop utilising virtualisation and a server?
    12·1 answer
  • Java Provide the command to call the calcCirArea() function using a value of 15 for the circle’s radius and storing the result
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!