196k views
1 vote
What will the following code display? #include using namespace std; int getValue(int); int main() { int x = 2; cout << getValue(x) << endl; return 0; } int getValue(int num) { return num + 5; } a. 5 b. 2 c. 7 d. getValue(x)

User Mihael
by
8.3k points

1 Answer

5 votes

Answer:

7.

Step-by-step explanation:

getValue takes a number as argument and returns that number plus two. 5+2=7

User Calumbrodie
by
8.6k points