Code failed, but need to find output.

Hi -
I'm supposed to figure out what the output of this code should be. However, when I run it in a compiler (using Microsoft Visual Studio at the moment), it won't build a solution/run the program, but no errors are highlighted by the compiler.
Any input would be great.
Thanks!

The code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream >

using namespace std;

void TestIt(int Y);

int main (void)

{

int A, B;

A = 5;

TestIt(A);

B = 3;

TestIt(B);

return 0;

}

void TestIt (int Y)

{

int Z(7);

static int X(2);

Z= Y*3 - Z;

Y = Y * 2;

X ++;

cout << "X = " << X << " Y = " << Y << " Z = " << Z << "\n\n" ;

return;

}
Remove the space after iostream on line 1.
I did, still won't work... :(
However, when I run it in a compiler (using Microsoft Visual Studio at the moment), it won't build a solution/run the program, but no errors are highlighted by the compiler.


How do you know that it does not work?
Topic archived. No new replies allowed.