Consider the intermediate code given below.

1) i = 1

2) j = 1

3) t1 = 5 ∗ i

4) t2 = t1 + j

5) t3 = 4 ∗ t2

6) t4 = t3

7) a[t4] = - 1

8) j = j + 1

9) if j < = 5 goto (3)

10) i = i + 1

11) if i < 5 goto (2)

The number of nodes and edges in the control - flow - graph constructed for the above code, respectively, are

This question was previously asked in
GATE CS 2015 Official Paper: Shift 2
View all GATE CS Papers >
  1. 5 and 7
  2. 6 and 7
  3. 5 and 5
  4. 7 and 8

Answer (Detailed Solution Below)

Option 2 : 6 and 7
Free
GATE CS Full Mock Test
5.4 K Users
65 Questions 100 Marks 180 Mins

Detailed Solution

Download Solution PDF

Concept:

Control flow graph (CFG) is the graphical representation of computation during the execution of programs or applications.

Control flow graph for the above intermediate code is given here as:

F1 58cd0b94032821391e0014ad 16.01.2020 D

Control flow graph contains 6 vertices and 7 edges.

Latest GATE CS Updates

Last updated on Jan 8, 2025

-> GATE CS 2025 Admit Card has been released on 7th January 2025.

-> The exam will be conducted on 1st February 2025 in 2 shifts.

-> Candidates applying for the GATE CE must satisfy the GATE Eligibility Criteria.

-> The candidates should have BTech (Computer Science). Candidates preparing for the exam can refer to the GATE CS Important Questions to improve their preparation.

-> Candidates must check their performance with the help of the GATE CS mock tests and GATE CS previous year papers for the GATE 2025 Exam.

Get Free Access Now
Hot Links: teen patti master purana teen patti joy 51 bonus teen patti stars rummy teen patti