Task

Show how to represent the boolean states "true" and "false" in a language.

If other objects represent "true" or "false" in conditionals, note it.



Related tasks

   Logical operations


int a = 0;
int b = 1;
int c;
string str1 = "initialized string";
string str2; //  "uninitialized string";
 
if (a) {puts("first test a is false");}         // This should not print
if (b) {puts("second test b is true");}         // This should print
if (c) {puts("third test b is false");}         // This should not print
if (!defined(c)) {puts("fourth test is true");} // This should print
if (str1) {puts("fifth test str1 is true");}    // This should print
if (str2) {puts("sixth test str2 is false");}   // This should not print