This is a simple C program that evaluates boolean expressions using macros to represent logical operators such as AND, OR, and NOT. The evaluation is performed according to conventional boolean rules.
- Boolean expression evaluation using AND, OR, and NOT.
- Utilizes macros to represent logical operators.
- Can handle more complex boolean expressions.
-
Compilation:
- Use a C compiler, such as GCC, to compile the code.
gcc -o logicgate logicgate.c -O3 -Wall
- Use a C compiler, such as GCC, to compile the code.
-
Execution:
- Run the compiled program.
./logicgate
- Run the compiled program.
-
Input Expressions:
- Enter boolean expressions when prompted by the program.
- For example:
NOT(OR(1, AND(1, 0)))
-
Result:
- The program will display the result of the entered expression.
Enter the boolean expression: NOT(OR(1, AND(1, 0)))
Result of the expression: 0