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
Maurinko [17]
4 years ago
7

Taking a suitable example in c language explain the of call by value and call by reference concepts.

Computers and Technology
1 answer:
Degger [83]4 years ago
8 0

Answer: The difference between call by value and call by reference is that in call by value the actual parameters are passed into the function as arguments whereas in call by reference the address of the variables are sent as parameters.

Explanation:

Some examples are:

call by value

#include <stdio.h>  

void swap(int, int);

int main()

{  int a = 10, b= 20;

 swap(a, b);

 printf("a: %d, b: %d\n", a, b);

}  

void swap(int c, int d)

{

 int t;

 t = c; c = d; d = t;

}  

OUTPUT

a: 10, b: 20

The value of a and b remain unchanged as the values are local

//call by reference

#include <stdio.h>

 void swap(int*, int*);

 int main()

{

 int a = 10, b = 20;

 swap(&a, &b);   //passing the address

 printf("a: %d, b: %d\n", a, b);

}

void swap(int *c, int *d)

{

 int t;

 t = *c; *c = *d; *d = t;

}

OUTPUT

a: 20, b: 10

due to dereferencing by the pointer the value  can be changed which is call by reference

You might be interested in
What is the significance of the scientific method?
Gnom [1K]
Hello there! The significance of the scientific method is that it ensures accuracy and it ensures that the experiment was done in the right order.

The scientific method is a widely accepted way of revising and rechecking the work of scientists to see if:

1. The answers match up

2. The experiment was performed correctly

3. The results are accurate

Through the scientific method, the probability is very high that things will not go wrong. The significance of this is that if the scientific method is not applied to an experiment, nobody knows the results. If nobody knows the results, there are many possible unintended consequences that could happen. Hope this helps!
6 0
1 year ago
At a local burger chain, a customer became extremely angry. Everyone took notice at the person, who was yelling at anyone he cou
leonid [27]

Answer: Donald, the branch manager displayed people skills  

Explanation: People skills are a combination of behavior and behavioral interactions between people. There are many abilities that fall under the category of people skills, for example, personal effectiveness, interactive skills and negotiation skills. While the customer was shouting, Donald patiently heard and tried to calm the customer which reflected that he respected and valued the customer and kept a positive behavior towards the customer.


5 0
3 years ago
Read 2 more answers
Hi I need help with an assignment. We're learning about encryption and decryption in code.org. i need help with three of the tex
MrMuchimi

Answer:

multiply divide and add

7 0
3 years ago
Which tool would be the best choice for removing and replacing the motherboard bios chip?
mamaluj [8]

An <u>IC extractor</u> would be the best choice for removing and replacing the motherboard bios chip.

<h3>What is a computer hardware?</h3>

A computer hardware can be defined as a physical component of an information technology (IT) or computer system that can be seen and touched.

<h3>The hardware components of a computer.</h3>

Some examples of the hardware components of a computer system and these include:

  • Random access memory (RAM).
  • Read only memory (ROM).
  • Central processing unit (CPU)
  • Keyboard
  • Monitor
  • Mouse
  • Motherboard bios chip

In Computer technology, an <u>IC extractor</u> would be the best choice for removing and replacing the motherboard bios chip.

Read more on motherboard bios chip here: brainly.com/question/17373331

#SPJ1

8 0
2 years ago
In a(n) _____, the web becomes an integral part of the application, rather than just a communication channel, and systems analys
IRISSAK [1]

In an <u>Internet-based system</u>, the web becomes an integral part of the application, rather than just a communication channel, and systems analysts need new application development tools and solutions to handle the new systems.

d) Internet-based system

<u>Explanation:</u>

Web information system, or web-based information system, is a data framework that utilizes Internet web advancements to convey data and administrations, to clients or other data frameworks/applications.

It is a product framework whose primary intention is to distribute and keep up information by utilizing hypertext-based standards. In an Internet-based system, the Web turns into a fundamental piece of the application, instead of only a correspondence channel, and frameworks investigators need new application advancement instruments and solutions to handle the new systems.

7 0
3 years ago
Other questions:
  • Read the excerpt below and answer the question.
    14·1 answer
  • Which of the following is CORRECT about database managementsystem's languages?
    6·1 answer
  • In fixed-width files, each record is on a separate line and the fields are separated by a special character.
    7·1 answer
  • A television advertisement claiming that a product is "light-years ahead of its time" does not make sense because (a) it doesn’t
    10·1 answer
  • You load an image file into a numpy array and look at its shape, which is (433, 650). What does this indicate?
    13·1 answer
  • How are people using lying today? What are the types of lying? Describe each type.
    7·1 answer
  • Which of the following statements comparing debit cards to credit cards is TRUE?
    13·2 answers
  • Develop a multithreaded app that can find the integer in the range 1 to 10000 that has the largest number of divisors. It should
    10·1 answer
  • Can someone help my friend play over-watch she new do it. I can't help her on Friday (p.s she play on Xbox she will get it on Fr
    8·1 answer
  • Which of the following are addressed by programing design? Choose all that apply.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!