Consider the following program segment: 1. int find-maximum (int i, int j, int k) 2. { 3.

Question:

Consider the following program segment:

1. int find-maximum (int i, int j, int k)

2. {

3. int max;

4. if(i>j) then 5. if (i

6. else max=k;

7. else if (j>k) max=j 8. else max=k 9. return (max);

10. }

(a) Draw the control flow graph for this program segment.

(b) Determine the cyclomatic complexity for this program (show the intermediate steps of your computation).

(c) How is the cyclomatic complexity metric useful?

Step by Step Answer:

Related Book For  book-img-for-question

Software Testing

ISBN: 9781107012967

1st Edition

Authors: Yogesh Singh

Question Posted: