my assignment is to figure out the output but im bot sure i got it right here is the Q
A variable x globally defined in your program is assigned the integer value 3. A variable x defined in a function named f_name is assigned the integer value 5. Answer the following after looking at the code that follows.
1 #include <iostream>
2 using namespace std;
3 int f_name(int y);
4
5 int x = 3;
6
7 int main()
8 {
9 cout << x;
10 cout << f_name(x);
11 return 0;
12 }
13
14 int f_name(int y)
15 {
16 int x = 5;
17 return (x + y);
18 }
What is the output of line 9? _________ line 10? _______________
would the answers be line 9: 4,,, and line 10: 6?