3
for(num2 = 0; num2 <= 3;  num2++)
{
  for(num1 = 0; num1 <= 2; num1++)
  {
        cout<< num2<< "   " << num1<< endl;
  }
} 

how to draw a control flow graph for the above code segment?

Thanks in advance :)

1 Answers1

4

I am studying for a test on this and it's still kind of vague, so I might be wrong, but I think it should be this:

  O<
 /| \
/ v /
| O<
| | \
| v /
| O
\
 >O

Please let me know if you got the same result, or if the graph is unclear I'll make a proper one.

Luc
  • 5,339
  • 2
  • 48
  • 48