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
Write its features:features of computer ​
Digiron [165]

Answer:

There are different characteristics of a computer is the following below.

Speed.

Accuracy.

Diligence.

Reliability.

Versatility.

Storage Capacity.

Automatic.

Quick Decision.

Explanation:

Sorse  

System https://quicklearncomputer.com

Mark brainlist if you want ¯\_(ツ)_/¯

5 0
3 years ago
Administrative activities, such as archiving project files, closing out contracts, documenting lessons learned, and receiving fo
asambeis [7]

Answer:

closing

Explanation:

6 0
3 years ago
3. By default, Blender® remembers your last 32 actions and allows you to undo them one at a time by pressing CTRL+Z. (1 point)
Setler [38]
Answers:

(3) True
(4) Num Lock

Explanations:
(3) To undo any task in most of the softwares including Blender, CTRL + Z is used. If you want to double check, go to preference ->  Input -> Search for undo. You would see CTRL + Z shortcut there for one time undo (as shown in the picture 1 attached.) Hence (TRUE).

(4) As in blender, during the scene creation, the designers usually use top, left, right or bottom view. Blender has the built-in keys set for those views. As you can see in the second image that the Top view is set to NumPad 7 (likewise others set to other numbers). In order to use the those numpad numbers, you must turn on the NumLock! Hence NumLock is the answer.

3 0
3 years ago
A spreadsheet has some values entered: Cell A1 contains 10, cell A2 contains 14, cell A3 contains 7. You enter in cell A4 the fo
lesya [120]
The value displayed in A4 is 24
5 0
3 years ago
7. One hazard associated with driving downhill is:
melamori03 [73]

Answer:

is this a multipe choice question? or should i answer what i would think is dangerous about driving down hill?

Explanation:

please elaborate so i can answer better! :D

4 0
3 years ago
Other questions:
  • Write a C++ program that prompt the user to enter v in meter/second(m/s) and the acceleration in a in meters/second squared (m/s
    15·1 answer
  • Which speaker port should you use when connecting a single speaker to a pc?
    6·1 answer
  • Electricity is moved from place to place a long __________​
    14·2 answers
  • My question is do you learn how to do a voice over in technology?
    14·1 answer
  • In order for bitlocker to protect the system volume without the aid of an external drive, your computer must:
    12·2 answers
  • Pride Group of Companies is making tremendous profits in different categories of electronic goods. The group of managers have to
    12·1 answer
  • Bao bì chủ động active packaging và bao bì thông minh intelligent packaging khác biệt như thế nào
    15·1 answer
  • marianne needs to create a version of her slide presentation that does not include all the slides and will be used for a particu
    9·1 answer
  • What tv show inspired the term spam for junk email?
    8·2 answers
  • Windows 8 uses a(n) ________ account for easy access and storage of online files.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!