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
ddd [48]
4 years ago
7

What is the difference between "call by value" and "call by reference"? Explain with example in c language.

Computers and Technology
1 answer:
Serjik [45]4 years ago
7 0

Answer:

<u>Call by reference</u>

In an function if the variables are passed as reference variables this means that the variables are pointing to the original arguments.So the changes made in the function on the reference variables will be reflected back on the original arguments.

For example:-

#include<stdio.h>

void swap(&int f,&int s)

{

   int t=f;

   f=s;

  s =temp;  

}

int main()

{

int n,m;

n=45;

m=85;

swap(n,m);

printf("%d %d",m,n);

return 0;  

}

the values of m and n will get swapped.  

<u> Call by value</u>

In this program the values of m and n will not get swapped because they are passed by value.So duplicate copies of m and n will be created and manipulation will be done on them.

#include<stdio.h>

void swapv(int f,int s)

{

   int t=f;  

   f=s;  

   s=temp;

}

int main()

{  

int n,m;

n=45;

m=85;

swapv(n,m);

printf("%d %d",n,m);

return 0;

}

You might be interested in
Label the parts of the plated salad.
sesenic [268]

Answer:

   3. Base (<em>under line</em>): usually a layer of salad greens that line the plate or bowl in which the salad will be served.

   2. Body (<em>main part</em>): consists of the main ingredients.

   1. Garnish: enhances the appearance while also complementing the overall taste; must be edible.

Dressing: liquid/ semi-liquid added to the body.

Explanation:

3 0
2 years ago
What is the process called when programmers look for and fix errors in code?
AveGali [126]

Answer:

d

Explanation:

7 0
3 years ago
Read 2 more answers
Which of the following is the term for an economic and social inequality based on access to, use of, or knowledge of technology
Georgia [21]

The answer is digital divide

4 0
3 years ago
Read 2 more answers
A(n) _____ is the address of a document or other file accessible on the internet.
Nataly_w [17]

Uniform Resource Locator (URL) is the address of a document or other file accessible on the internet.

<h3>What us URL?</h3>

The address of a document or other file that is accessible via the Internet is known as a Uniform Resource Locator (URL). A hyperlink, often known as a link, is a component that joins two Web pages together.

A web address, also known as a Uniform Resource Locator, is a reference to a web resource that identifies its location on a computer network and a method of retrieval. Though many people mistakenly use the terms "URL" and "Uniform Resource Identifier" interchangeably, a URL is a particular kind of URI.

<h3>How do you write an URL address?</h3>

http://www.example.com/index.html, which denotes a hostname (www.example.com), a protocol (http), and a file name ( index. html ).

To learn more about URL visit:

brainly.com/question/18926479

8 0
1 year ago
When typing lists in a document, you must use single-spacing between each item in the list.
dexar [7]
False False true
Hope it helps
4 0
3 years ago
Other questions:
  • What is the portion of the PowerPoint window that contains the current slide, total slides, zoom options, and various shortcuts
    8·1 answer
  • The c++ operator _______________ is used to destroy dynamic variables.
    5·1 answer
  • Bob has been assigned to set up a digital certificate solution for use with e-mail. One of the requirements he has been given is
    10·1 answer
  • You can easily view the ruler on a document by selecting the Show Ruler button located _____.
    11·2 answers
  • How many yards must you run to complete a 100 meter dash?
    6·2 answers
  • Trudy is preparing a reply to an email message. Before she could send out the message, she is called for a meeting. If Trudy has
    6·2 answers
  • In the range D5:D9 on all five worksheets, Gilberto wants to project next year's sales for each accessory, rounded up to zero de
    6·1 answer
  • What are the four major software packages of microsoft​
    11·1 answer
  • Select the three subjects studied in sports biomechanics.
    9·1 answer
  • what is true about the depth of the troposphere? group of answer choices it varies with passing air masses. it is shallower in s
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!