Home > Mobile >  Comparing Multiple Strings Using || Logical Operator Is Not Working Properly in C language [duplicat
Comparing Multiple Strings Using || Logical Operator Is Not Working Properly in C language [duplicat

Time:09-23

I am trying to check if the user string input (after lowercasing user input) matches with required three strings i.e. rock or paper or scissor. If it doesn't match the requirement the system will print It is a wrong input. Otherwise, I'll do something.

When I'm giving only one check without the logical || operator, it is working fine i.e. comparing the user input string with the required one. But when I'm using logical operator it is not working properly i.e. if I give right keyword, it is saying that it is a wrong input.

Being a beginner I couldn't figure out the possible reason after searching in StackOverflow also. Any help in advance. Thank you

  • Related