Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

boolean operators in C

int a = 4;
int b = 5;
bool result;
result = a < b; // true
result = a > b; // false
result = a <= 4; // a smaller or equal to 4 - true
result = b >= 6; // b bigger or equal to 6 - false
result = a == b; // a equal to b - false
result = a != b; // a is not equal to b - true
result = a > b || a < b; // Logical or - true
result = 3 < a && a < 6; // Logical and - true
result = !result; // Logical not - false
Source by www.learncs.org #
 
PREVIOUS NEXT
Tagged: #boolean #operators #C
ADD COMMENT
Topic
Name
8+5 =