Consider the intermediate code given below:
The number of nodes and edges in the control-flow graph constructed for the above code, respectively are X and Y. The value of X + Y is ________.
@Lone Wolf answer is 4 nodes and 4 edges, because you didn't consider start and end nodes and their respective edges.
here are only 5 basic blocks possible a block A , block B ,block C, block D, block E
(A) start (B) a=10 (B) b=15 (C) a= a+b (C) b = a-b (C) a = a-b (D) if a==b goto 3 (E) end
so answer should be 10 (5 nodes and 5 edges)
64.3k questions
77.9k answers
243k comments
79.7k users