2 votes 2 votes 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 ________. Compiler Design compiler-design intermediate-code made-easy-test-series + – rahul sharma 5 asked Jan 24, 2018 • edited Mar 4, 2019 by ajaysoni1924 rahul sharma 5 1.3k views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply joshi_nitish commented Jan 24, 2018 reply Follow Share it will have 4 edges and 4 nodes. 2 votes 2 votes rahul sharma 5 commented Jan 24, 2018 reply Follow Share yes.Although i selected wrong and later got 4 and 4 but ehy have given 5 and 5,which does not seem corr ect 0 votes 0 votes Lone Wolf commented Aug 22, 2018 reply Follow Share how you are getting 4 nodes here are only 2 basic blocks possible a block A , block B (A) a=10 (A) b=15 (B) a= a+b (B) b = a-b (B) a = a-b (B) if a==b goto 3 so answer should be 4 (2 nodes and 2 edges) 0 votes 0 votes chauhansunil20th commented Dec 1, 2018 reply Follow Share @Lone Wolf answer is 4 nodes and 4 edges, because you didn't consider start and end nodes and their respective edges. 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes HERE THE TWO BASIC BLOCKS ARE FORMED SO THE TOTAL NUMBER OF NODES =#TOTAL NO. BASIC BLOCKS+START +END=4 TOTAL NUMBER OF EDGES=4 SO X=4 AND Y=4 X+Y=8 ANS ritesh5040 answered Jul 3, 2019 ritesh5040 comment Share Follow See 1 comment See all 1 1 comment reply zero cool commented Mar 26, 2021 reply Follow Share 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) 0 votes 0 votes Please log in or register to add a comment.