What will be the value of the k variable after the function f is called from the main:

void f(int &a)
int main()
    int k = 0;
Argument in f function if passed by reference, that's why value of k is changed. More information: Passing parameters by references in C++

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback