Don't know if any1 can help me here but I'm stuck.
If I have to draw variable diagrams about the following stuff:
#include <iostream>
Using namespace std;
Const AA = 200;
Int func1(int n, int n1)
{
N -= 3;
N1+= n;
Return 2 * n * n1
}
Void func2(int n, int & n1)
{
N = 2 * n1;
N1 = 3n;
}
Void func3 (int & n, int & n1)
{
Int k;
K = n + AA;
N = 2 * n1;
N1 = 1 + 2 * k;
}
Int main ()
{
Int n, m, j;
N = 3;
M = 5;
J = func1(n, m);
N = 10;
M = 15;
Void func2(n, m);
N = 20;
M = 25;
Void func3(n, m);
Return 0;
}
That is what they gave me and said draw variable diagrams. But I'm stuck cause I don't know how to get the value for j, and what do I do with the value of n1 cause the N value I know what to do, what also confuses me is the fact they say void func2(n, m) but they give value n and n1.
@Stephie22
You had some of the variables capitalized while referring to then in lower case. Each of those would be a different variable. When calling a function, you don't use the void keyword in front of it. Here is your program with the changes. Don't really know if the answers are correct, but that would be for you to figure out.