| 1001: | i=1 |
| 1002: | j=1 |
| 1003: | t1=10*i |
| 1004: | t2=t1+j |
| 1005: | t3=8*t2 |
| 1006: | t4=t3-88 |
| 1007: | a[t4]=0.0 |
| 1008: | j=j+1 |
| 1009: | if j<=10 goto 1003 |
| 1010: | i=i+1 |
| 1011: | if i<=10 goto 1002 |
| 1012: | i=1 |
| 1013: | t5=i-1 |
| 1014: | t6=88*t5 |
| 1015: | a[t6]=1.0 |
| 1016: | i=i+1 |
| 1017: | if i<=10 goto 1013 |
Correct : 4
To identify basic blocks, we find leaders (starting points) and group consecutive statements until a jump or branch. Leaders include the first statement, targets of jumps, and statements immediately following conditional jumps.
The leaders in this code are at lines 1001, 1002, 1003, 1010, 1012, and 1013. This creates six basic blocks: Block 1 (line 1001), Block 2 (line 1002), Block 3 (lines 1003-1009), Block 4 (lines 1010-1011), Block 5 (line 1012), and Block 6 (lines 1013-1017).
β Final Answer: 6
Reason: Each leader starts a new basic block, and consecutive statements without control flow changes belong to the same block.
Similar Questions
Total Unique Visitors