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.
He should use a scanner, which would convert an image into an electronic file.
Answer: c) Web 2.0
Explanation:
Web 2.0 is the technology that consist applications and websites for the people to interact and sharing information, activities, event and other materials through social media components like blog, social networking sites,wikis, podcast etc.
- Other options are incorrect because artificial intelligence, ERP(Enterprise resource planning) and XML(Extensible Markup Language) are not the tools that is used by users for interaction and communicating with the help of social media components.
- Thus, the correct option is option(c).
Answer:
subset([],[]).
subset([X|L],[X|S]) :-
subset(L,S).
subset(L, [_|S]) :-
subset(L,S).
Success:
subset([1,3], [1,2,3]).
subset(X, [1,3,4]). % error handling to compare sets in a given order
Fail:
subset([2,1], [1,2,3]). % compares in a different order from the first.
Explanation:
The function "Subset" in the source code above accepts two sets, then checks if the first set is a subset of the second. The code returns true if the condition is met.