Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
PHp not equal to and OR command
Name: ian_ok Date: November 4, 2005 at 09:32:15 Pacific OS: win xp 98 & 2k CPU/Ram: p3 512
Comment:
If user enters in (YES/NO/Don't know) I want code to continue testing if they enter in other I want it to stop.
Name: Michael J (by mjdamato) Date: November 4, 2005 at 18:53:40 Pacific
Reply:
I don't understand your question exactly, but I see why your case statement is not working. When you use the OR statement as you did if any of the tests are true, then the test is true. So, if the response was "Yes" then the first case would return false and then the next two cases would return true making the entire test true. So there is no way to get a false response from that test. You need to use ANDs instead
Summary: I think the snag is here: ==== if((code !=1) || (code !=2) || (code !=3)) ==== At least two of your "not equal" tests [!=] will be true regardless of the code the user enters. Try something like: ====...
Summary: I want to read the data from a file and execute it.Question is as shown. Can anyone provide the code for the below question. Input Description: The first line contains an integer t which is the number...