How to draw a Control flow graph for a given procedure? [closed]

  c++, complexity-theory, flow, graph

I want to draw a control flow graph for this code :

 1.char x='P';
   2.int m;
     3.  for (int s=2;s<=100;s++)
       4.{
         5.  for(int m=2;m<=s/2;m++)
          6.{
           7.if (s%m==0)
            8.{
              9. x='N';
               10.break;
             11.}
          12.}
       13.if (x=='P')
          14.  cout<<s<<endl;
       15.x='P';
      16.}

Here is my answer

Source: Windows Questions C++

LEAVE A COMMENT