lundi 18 décembre 2017

Drawing a Control Flow Graph with an output

I'm currently learning to draw Control Flow Graphs and I'm not sure whether I'm drawing it right for the following scenario:

For the following fragment of code, where x and y are the input variables and z is the output variable:

if x=0 then x:=10
if x<y-5 then y:=y-1 else x:=y+5
z:=y-x

This is what I've done: enter image description here

Is this correct in any way? thanks in advance

Aucun commentaire:

Enregistrer un commentaire