Answer: While constructing a function the parameters can be passed by value or by reference.
In value parameter we actual make a copy of the values which has been passed to the function from the main method while we reference parameter we copy the address of the values in memory so that while our program references those values it it can refer them from their memory location.
Explanation:
Now we take can example to show parameter passing by value and reference with the help of an C program to add two numbers
int add_val(int x, int y) {
return x + y;
}
void add_ref(int *x, int y) {
*x += y;
}
int main () {
int a, b, c, d;
a = 2;
b = 1;
c = add_val(a,b); //value parameter
d = add_ref(&a, c); // reference parameter
return 0;
}
In the above code the value the value of c is 3 and the value of d is 5. In add_p we have passed the address of the a but in add_val we have passed the values of a and b.
Answer:
The program in Python is as follows:
wordInput = input()
myList = wordInput.split(" ")
for i in myList:
print(i,myList.count(i))
Explanation:
This gets input for the word
wordInput = input()
This splits the word into a list using space as the delimiter
myList = wordInput.split(" ")
This iterates through the list
for i in myList:
Print each word and its count
print(i,myList.count(i))
An increase in the number of stress and health concerns that result from working in a computer environment.
Let's look at the available options and see what is, or is not an advantage.
Web designers have created websites that allow individuals to shop, promote business, bank, and communicate via social media sites.
* This means that people don't actually have to travel in order to do their business and meet new people. Sounds like an advantage to me, so this is a bad choice.
An increase in the number of stress and health concerns that result from working in a computer environment.
* Hmm. People getting sick. Doesn't sound like anything I'd like. So this isn't an advantage and is the correct answer.
Medical diagnoses can be made earlier
* Faster diagnoses of diseases. Sounds like an advantage to me. So this is a bad choice.
Businesses can save costs on travel by meeting online using teleconference options
* Saving money and time. Sounds like an advantage. So this is a bad choice.