Top "Logical-operators" questions

Logical operators are symbols that aid in evaluating boolean expressions.

Why is "if (i++ && (i == 1))" false where i is an int holding the value 1?

{ int i = 1; if (i++ && (i == 1)) printf("Yes\n"); else printf("No\n"); } As per my understanding, in the …

c if-statement logical-operators
Behaviour of && in C programming language

I am beginner in C programming language, recently I have read about Logical AND && operator. I also know …

c operators logical-operators
Java short circuit evaluation

I thought Java had short circuit evaluation, yet this line is still throwing a null pointer exception: if( (perfectAgent != null) &…

java logical-operators short-circuiting
Confused by use of double logical not (!!) operator

I have some C++ code that makes extensive use of !!. I'm kinda baffled because as far as I know !! is …

c++ bitwise-operators logical-operators
Multiple conditions in if statement on both sides of the logical operator

I was experimenting with having multiple arguments in an if statement on both sides of the logical operator. I first …

javascript if-statement logical-operators multiple-conditions
Logic Evaluator in c# (Evaluate Logical (&& ,|| ) expressions)

In my project there is a Logic evaluation section, it take input as a string which contains logical expressions (true/…

c# linq boolean-logic logical-operators dynamic-linq
Short circuiting statement evaluation -- is this guaranteed? [C#]

Quick question here about short-circuiting statements in C#. With an if statement like this: if (MyObject.MyArray.Count == 0 || MyObject.MyArray[0].…

c# conditional-operator logical-operators short-circuiting
PHP: 'or' statement on instruction fail: how to throw a new exception?

Everyone here should know the 'or' statemens, usually glued to an die() command: $foo = bar() or die('Error: bar function …

php exception exception-handling logical-operators
C Relational Operator Output

#include <stdio.h> void main() { int x = 1, y = 0, z = 5; int a = x && y || z++; printf("%d", …

c logical-operators or-operator and-operator
Reverse of the logical operator AND (&)

a + b = c c - a = b Ok, now a & b = c c ?? a = b which operator replace "??" ? Thanks

logical-operators boolean-logic