CC/tester/testsuite/good/core013.jl
Jeena Paradies 063194f8be first commit
2011-04-19 11:37:05 +02:00

33 lines
No EOL
621 B
Julia

/* Test boolean operators. */
int main() {
printString("&&");
printBool(test(-1) && test(0));
printBool(test(-2) && test(1));
printBool(test(3) && test(-5));
printBool(test(234234) && test(21321));
printString("||");
printBool(test(-1) || test(0));
printBool(test(-2) || test(1));
printBool(test(3) || test(-5));
printBool(test(234234) || test(21321));
printString("!");
printBool(true);
printBool(false);
return 0 ;
}
void printBool(boolean b) {
if (!b) {
printString("false");
} else {
printString("true");
}
return;
}
boolean test(int i) {
printInt(i);
return i > 0;
}