Question

Truth Table

The goal of this assignment is to understand how to evaluate Boolean expressions, and practice C

programming.

Create a program to print only truth tables as shown in the example below.

./truthtable 3 A*B C+D E F^A

A | B | C | A*B | C+D |

0|0|0|0|0|

1 | 0|0|0 | 0 | 1

0

1

1 | 1

0

0

| 0

I 1

İ

1 |

|

1

1 İ

1 |

0

1 I 1

0 | 1

1

|

0

0

0 | 100

1 | 1 |

The first parameter is the number of Boolean inputs. These are named sequentially beginning with A.

The rest of the parameters are Boolean expressions in one of the following forms:

Question image 1