RosettaCodeData/Task/Logical-operations/Bc/logical-operations-1.bc
2017-09-25 22:28:19 +02:00

25 lines
314 B
Text

/* The following three functions assume 0 is false and 1 is true */
/* And */
define a(x, y) {
return(x * y)
}
/* Or */
define o(x, y) {
return(x + y - x * y)
}
/* Not */
define n(x) {
return(1 - x)
}
define f(a, b) {
"a and b: "
a(a, b)
"a or b: "
o(a, b)
"not a: "
n(a)
}