125k views
3 votes
What will be displayed on the

console given the following code fragment?
int main() {
int num1 = 3;
int num2 = 4;
myFunction (num1, num2);
system("pause");

return 0;
}
void myFunction (int num1Par, int num2Par) {
cout << num1Par << num2Par;
}

A) 33
B) 34
C) 35
D) 36

1 Answer

4 votes

Answer:

The answer to this question is the option "B".

Explanation:

In c++ program that is given in the question. The explanation of the program can be given as:

This program starts with the main method in the main method there are two integer variable defines with there value that is num1=3 and num2=4. Then we call the function that is myFunction() function. In this function, we pass the variable num1 and num2 as a parameter and end of the main function or method. Then we define the myFunction() function. This function does not return any value because its return type is void. In this function, we print the value that is passed in the parameter. So the answer to this question is option B which is 34.

User JM At Work
by
5.7k points