1 1 vote Consider the following intermediate code segment:\[\begin{array}{l}\verb|(1) a = 1| \\\verb|(2) if a > 0 goto (4)| \\\verb|(3) a = a * 2| \\\verb|(4) b = 5| \\\verb|(5) if b < 10 goto (10)| \\\verb|(6) a = a + b| \\\verb|(7) b = b + 1| \\\verb|(8) b = b * 3| \\\verb|(9) goto (5)| \\\verb|(10) return a|\end{array}\]The number of nodes and edges in the control-flow graph constructed for the above code, respectively, are:$6$ and $7$ $8$ and $10$ $5$ and $6$ $6$ and $8$ Compiler Design goclasses compiler goclasses-cs-dpp goclasses-cs-dpp-day-149 goclasses-compiler-practice-questions + – GO Classes 411 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
1 1 vote There are 6 leaders: $1,3,4,5,6,10$ Hence no of nodes $=6+2=8$ there are $7$ sequential edges (including $2$ edges for entry and exit node) and $3$ goto edges so no of edges $=7+3=10$ GO Classes answered Dec 4, 2025 GO Classes comment Share Follow See 1 comment 1 1 comment reply Prince_Garg commented Dec 13, 2025 reply Follow flag There should be 9 edges, there were no edge b/w (9,10). 1 1 replyShare Please log in or register to add a comment.
1 1 vote 8 nodes and 9 edges Will be the correct ans Samrat_Ghosh answered Dec 15, 2025 Samrat_Ghosh comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes B JAY_THAKAR answered Jan 14 JAY_THAKAR comment Share Follow 0 reply Please log in or register to add a comment.