Problem 1 Solution

$30.00 $24.00

At the beginning of class on the due date, submit your neatly presented solution with this page stapled to the front (5 points). Given the following C program, construct two intermediate representations for the program: an abstract syntax tree (AST) and a list of 3-address code statements. main() { int sum, i, j; 1. sum…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:
Tags:

Description

5/5 – (2 votes)

At the beginning of class on the due date, submit your neatly presented solution with this page stapled to the front (5 points).

Given the following C program, construct two intermediate representations for the program: an abstract syntax tree (AST) and a list of 3-address code statements.

main()

{

int sum, i, j;

1. sum = 0;

2. i = 1;

3. while (i <= 5) { 4. scanf(“%d”,&j);

5. if (j < 0)

  1. break;
  2. sum = sum + j;
  3. if (sum > 10)
  4. continue;

10. i = i + 1;

11. }

12. printf(“sum is %d”, sum);

}

1

Problem 1 Solution
$30.00 $24.00