This is realy a bad question. For what purpose the code is write? Are you test members in Code project? Listen program1, there is no comparison in if condition. ie, watch your code
if( x = 3 )
. Actualy here value 3 is assigned to x. no comparison is done.
Don't post this type of question in code project. You can debug the code and ensure what happend.