Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (27 sloc) 672 Bytes
int main() {
int z;
z = 1;
print("1..4\n");
if (z) {
print("ok 1 - simple test for non-zero value is true\n");
}
else {
print("not ok 1 - non-zero value is not true!\n");
}
int y;
y = 0;
if (y) {
print("not ok 2 - zero is evaluated as true!\n");
}
else {
print("ok 2 - zero is evaluated as false.\n");
}
if (z || y)
print("ok 3 - 1 || 0 is true\n");
else
print("not ok 3 - 1 || 0 is evaluated as false\n");
if (z && y)
print("not ok 4 - z && y is false\n");
else
print("ok 4 - z && y is false!\n");
}