Sep 11, 2014 at 8:22am UTC
This does not even compile for me.
while (num != O){
You have not initialised either of these variables.
Sep 11, 2014 at 8:38am UTC
This is "O" not "zero"..
And it compiles for me
And also I didnt understand your word "these variables" can you discuss more please?
Sep 11, 2014 at 8:39am UTC
while (num != O){
at this exact point in time, what do you think the value of 'num' is? (and your 'O' as well).
Last edited on Sep 11, 2014 at 8:40am UTC
Sep 11, 2014 at 8:57am UTC
You mean it print the "Error" string as I entered it(the charachter"O") , so it should be like what or the code itself is wrong?
Last edited on Sep 11, 2014 at 9:07am UTC
Sep 11, 2014 at 9:12am UTC
No, i mean that when it evaluates that condition you have NOT set 'num' to be anything. It could be ANY value. You need to initialise it like you've done with your other variables.
And you need to initialise 'O' as well (which is a terrible name for a variable).
Sep 11, 2014 at 9:25am UTC
Love you Got it now.. sorry for bothering you
Sep 11, 2014 at 9:33am UTC
I was too dumb.. it worked now..
I wanted to thank you again..
Thanks SIR!