Description
In this project, you should implement a C interpreter. The supported input file should at least contain the following features:
- integer and floating-point data types: int, float.
- Statements for arithmetic computation. (ex: a = b+2*(100-1)) (3) Comparison expression. (ex: a > b)
- if-then-else program construct.
- printf() function with one/two parameters. (support types: %d, %f)
- scanf() (support types: %d, %f)
The following is a sample C program (input file):
- void main()
- {
- int num;
- float s;
- printf(“Please enter a number:”); 7. scanf(“%d”, &num);
- if (num > 10) {
- s = 3 * (num + 3.14);
- } else {
- s = num * (num – 3.14);
- }
- printf(“The result is %f\n”, s);
- }



