okay:
1. after a cin>> command, you should type cin.get();
the function of cin.get() is to discard the last piece of input you've put into a certain variable. This is very usefull, because when you press 'enter' on your keyboard, the ASCII code for 'enter' is added to your input
2.
cout << "w1 = ";
cin >> w[1];
cout << "w2 = ";
cin >> w[2];;
you use the ';' sign two times after cin>> w[2];
so it should be:
cout << "w1 = ";
cin >> w[1];
cout << "w2 = ";
cin >> w[2];
3. you declare this variable:
int x1
and at the end of the program, you say that x1 should be the entire array of 'train'
x1 = train; //input for x1
x2 = train[1]; //input for x2
Yd = train[2]; // desired output
//find weighted sum of inputs and threshold values
Out = x1*w[1] + x2*w[2] - teta;
4. You use C++ to program your program. However, you use 3 c-libraries, why aren't you using: "stdlib.h", "time.h" and "math.h" I also can't see the point in using time.h because you aren't using any of it's functions. And math.h is also unnesecary because you aren't using any complex mathmetics (sin, cos, tan functions etc.)
5. Either your shift key is stuck, or you should read this article:
clicky;-)
6. Last but not least, you use a loop to define the variable 'out' a couple of times. However, your 'cout<< Out;' command is placed AFTER the for loop. Was this your intention?