GATE Assistant

Past questions › Computer Science and Information Technology › GATE 2021 set1

GATE 2021 set1 · CS · NAT · 2 marks · Compiler Design › Code Optimization

GATE 2021 set1 Computer Science and Information Technology question: Consider the following C code segment: code In a compiler, this code segment is…

Consider the following C code segment:

a = b + c;
e = a + 1;
d = b + c;
f = d + 1;
g = e + f;

In a compiler, this code segment is represented internally as a directed acyclic graph (DAG). The number of nodes in the DAG is ______.

Show answer

Official answer: 6

Practise this question with exam-style marking

Discussion

No discussion yet.

Join the discussion