Programming Fundmentals

What is complex conditions?

I think you’re referring to when there is more than one conditional test. For example, a simple condition would be:

if (x>3) {
  /* code */
}

It’s simple because it’s only testing one thing. If you have more than one test, it’s complex:

if (x > 3 && y != 17) {
  /* code */
}

This is testing if x is greater than 3 and that y is not equal to 17. With logical operators, you can create very complex conditions.

If that isn’t what you mean, perhaps some context would help. Or maybe someone smarter has a better answer.

2 Likes