How to write an if statement with multiple || and && in C? -
what concise way write if statement more many || , && in c?
i want execute printf statement if either 1,2,4 or 6 , b = 8 , c = 10, can put these conditions same if statement?
eg. can write like:
if ((a = 1||2||4||6) && b == 8 && c == 10)
//do something
this doesn't seem work...
if ((a == 1 || == 2 || == 4 || == 6) && b == 8 && c == 10)
Comments
Post a Comment