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
A citizen of any group both
erastovalidia [21]

Answer:

Rights and Responsibilities

Explanation:

4 0
3 years ago
Who wants to be my tutor?
anzhelika [568]

Answer:

i would but im not big brain

Explanation:

8 0
3 years ago
Read 2 more answers
3. Do some Internet research on the use of VLANs in hospitals. Summarize the benefits of using VLANs in hospitals and identify e
motikmotik

VLAN refers to Virtual Local Area Network. It is a subnetwork that can group together collection of devices on separate physical Local Area Networks. VLANs allow network administrators to group hosts together even if the hosts are not directly connected to the same network switch.

Considering the large number of departments in hospitals, with each departments having functions different from the others, Virtual LANs allows various users(the departments) to be grouped together according to their networking needs, regardless of their actual physical locations. Subdividing the LAN into smaller segments, or VLANs, increases overall reliability, security, and performance, and makes the network easier to maintain.

Because of the largeness of St. Luke's hospitals and their mission of delivering highly reliable and feature-rich advanced network solutions, virtual LAN will help to provide a resilient and scalable network solution within the hospital's budget.

St. Luke should implement virtual LAN that can produce a higher bandwidth with lower-cost, a longer-term model based on servers, networking products and homogenous network components to deliver centralized management of computing across the hospital network.

5 0
3 years ago
Read 2 more answers
(50 points) Jeff wants to create a responsive web page where elements change size according to the size of the window. How would
iris [78.8K]

Answer:

make the element sizes a percentage

Explanation:

Without using a framework specified for this type of thing such as Bootstrap, the best way to do this would be to make the element sizes a percentage. By making the size of everything a percentage it will automatically resize itself to take up the same percentage of the screen at all times. Even when the browser window is resized to any size that the user wants. This also applies to monitors of different sizes and mobile devices.

5 0
3 years ago
What is the device used for the calculations of payment and balancing the accounts record s​
Greeley [361]
A calculator or bank? Maybe an atm
6 0
2 years ago
Read 2 more answers
Other questions:
  • If you want an app to reach the largest possible audience, which two platforms should you use?
    7·1 answer
  • What best describes the advantage of using the model of a food web?
    12·2 answers
  • The speed of sound depends on the material the sound is passing through. Below is the approximate speed of sound (in feet per se
    9·1 answer
  • In which part of a browser will you type the url of a website
    11·1 answer
  • i will be doing an interview to someone so plz comment down below something random and you will automatically enter
    11·1 answer
  • Which statement best describes the cut and paste option in a word processor?
    6·2 answers
  • Dotted Decimal Notation was created to______________. Group of answer choices provide an alternative to IP addressing express ea
    12·1 answer
  • The illustration shows different types of text language.
    5·2 answers
  • Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not
    10·1 answer
  • ¿por que hay peligros en internet?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!