3 ms·
I don't think the "living nightmare" control flow graph is that bad? B is once again a while(input == 0) loop, that exits to D. D and C together form a while(
by Sniffnoy 5y ago
I don't think the "living nightmare" control flow graph is that bad?
B is once again a while(input == 0) loop, that exits to D. D and C together form a while(input == 1) loop, that exits to A. And A is again a switch between two routes, although in this case, rather than dispatching to one of two independent routes, it switches between a full route (go to B) and a partial route (jump straight to D); basically you could consider B and C to exist together in an if-block of sorts.
- nickdrozd 5y agoIt's possible to write the first one straight out in C using only whiles, with no breaks and no continues. Can the same be done with the second? Maybe, but I couldn't figure out how.