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]
3 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]3 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 a Coral program using integers userNum and x as input, and output userNum divided by x four times.
ss7ja [257]

Answer:

second_int = "Enter the second integer: "

usernum = int(input("Enter the first integer: "))

x = int(input(second_int))

usernum = usernum // x

print(usernum, end= ' ')

usernum = usernum // x

print(usernum, end= ' ')

usernum = usernum // x

print(usernum, end= ' ')

usernum = usernum // x

print(usernum)

Explanation:

im good

7 0
3 years ago
What kind of physical device is an evil twin access point? What does the evil twin do after initial association when the victim
Rufina [12.5K]

Answer:

A PC such as a notebook computer.The evil twin gets the encrypted frame from the affected host,A VPN  encrypts a  frame with its own VPN key.

Explanation:

The evil twin after initial association when the victim client will establish a secure wireless connection with the victim client. The connection uses a key client-EF for encryption such that when the host transmits an encrypted frame it is transmitted to the evil twin. A VPN is an encrypted virtual private network used to access networks that are not trusted. The client encrypts a frame with a VPN key (Key Client-Server) which it shares with the server. The frame is further encrypted by the key it shares with the evil twin (Victim Client-ET) The evil twin will then receive a double encrypted frame. However, it will only be able to decrypt the Victim Client-ET key but not the VPN key hence it will not be able to read the message sent through the frame.

7 0
3 years ago
Why people shouldnt get married​
inn [45]
Well it depends if your thinking! I know many reasons why people should get married but I also know many reasons why people shouldn’t get married!

For an example if you are a man and you don’t want to get married, well I think it’s 50% wrong and another 50% right cause if you want to enjoy life and not be stuck with the same wife you wouldn’t get married, but now think of having a family when you get married you receive a blessing, cause you will have son , daughters and a wife who will support you all the time!
3 0
3 years ago
A general rule for adding text to a slide is ____.
KiRa [710]

A general rule for adding text to  a slide is to use not more than two fonts in a presentation and vary the font  size. Besides adding text you can also import text, photographs, numerical data, and facts from files created in programs such as Microsoft word, excel and access.

5 0
3 years ago
Read 2 more answers
Read the following scenario. How might Sarah correct successfully complete her task? To permanently remove a file from her compu
Mekhanik [1.2K]

I'd go with two answers.

A: To permanently remove a file from her computer, Sarah doubled-clicked on the My Computer icon and searched for her file under the “Uninstall or change a program” menu option.

Or

B: Empty the Recycle Bin.

This question is somewhat not clear. Why I went with the answers above is because I really do not know what kind of a file Sarah wants to permanently remove. You can permanently delete a program file installed in the computer by following the procedure in option A. The option above will take you to the control panel and you'll be able to select the program you'd want to permanently remove. If you had initially deleted a file like a picture or a document or anything else that you necessarily do not need, it will go to recycle bin. You can head over there and select the Empty the Recycle Bin option to permanently delete the file.

7 0
3 years ago
Other questions:
  • Which command can be used to manually add a package to the driver store?
    13·1 answer
  • Write an original idiom that uses the word dog or dogs im in 4th
    5·2 answers
  • A location in memory used for storing data and given a name in a computer program is called a because the data in the location c
    14·1 answer
  • The most accurate readings that you can take on an analog VOM are when the meter's pointer is at the A. center scale. B. extreme
    11·1 answer
  • Why was the pilgrim's first corn crop such as successful one??
    7·1 answer
  • Name all mario kart games in order
    15·2 answers
  • Is social media bringing people together or cause in sepretation?​
    11·2 answers
  • Information to develop a project network is collected from the.
    6·1 answer
  • In Fantasy Football, participants compete against one another by choosing certain players from different NFL teams that they thi
    14·1 answer
  • Write a function called printRange() that accepts two integers as arguments and prints the sequence of numbers between the two a
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!