Here is a small function definition void f int i int k 2-03672
Here is a small function definition:<br>void f(int i, int &k)<br>{<br>i = 1;<br>k = 2;<br>}<br>Suppose that a main program has two integer variables x and y, which are given the value 0. Then the main program calls f(x,y); What are the values of x and y after the function f finishes?
This multiple choice question (MCQ) is related to the book/course vu cs301 Data Structures. It can also be found in vu cs301 Mid Term - Quiz No.16.
Here is a small function definition:
void f(int i, int &k)
{
i = 1;
k = 2;
}
Suppose that a main program has two integer variables x and y, which are given the value 0. Then the main program calls f(x,y); What are the values of x and y after the function f finishes?
void f(int i, int &k)
{
i = 1;
k = 2;
}
Suppose that a main program has two integer variables x and y, which are given the value 0. Then the main program calls f(x,y); What are the values of x and y after the function f finishes?
Both x and y are still 0.
x is now 1, but y is still 0.
x is still 0, but y is now 2.
x is now 1, and y is now 2.