I fully expect downvotes, but I became very curious, and I hope someone can answer. Our discrete mathematics professor really loves old languages for the many bitwise operators that they provide. Now he gave us homework, which was to determine the output of the following BASIC expression:
PRINT (NOT (15 OR 51) EQV 85) IMP (15 AND 51)
I solved this, and I'm pretty sure it should output -105, but I wanted to compile it to make sure. Then I realized that I was facing a problem. I have no idea what BASIC is! The compiler for the source language BASIC could not compile it. The QBasic compiler could not compile it. the VB.NET compiler could not compile it, even after I changed it to what I think should be the VB.NET syntax as follows:
Console.WriteLine((NOT (15 OR 51) EQV 85) IMP (15 AND 51))
The question arises: is there even a BASIC species or dialect in which a program with this statement can be compiled? And if so, which one?
source
share