ctruthtable

True and False for && logic and || Logic table


Table true/false for C Language

I have heard of a table true false for C Language for and && or || is kind of the mathematics one for which they say if true+true=true and false+true=false

I'm just kind of confuse on this and I tried to do the research but couldn't find any of the table

I just wish to have this table for my notes since I will do more in C language

if someone could bring me to the site or resources where they explain about this more


I've edited my original question to make it a note for my own study. Thanks @thiton for the great references and the rest for an awesome answer/resources.

Logical AND (&&)

false && false: false

false && true: false

true && false: false

true && true: true

Logical OR (||)

false || false: false

false || true: true

true || false: true

true || true: true

Logical NOT (!)

!false: true

!true: false


Solution

  • You probably mean a truth table for the boolean operators, which displays the result of the usual boolean operations (&&, ||). This table is not language-specific, but can be found e.g. here.