posted 14 years ago
There isn't really a short-cut. What I'd recommend is drawing a quick table. In this case you'd have three columns - j, k and output. Then just step through the program, writing out the values as they change. It really shouldn't take that long - took me about a minute when I tried it just now (a little longer to format it below, though!), and the exam gives you quite a bit more than that per question.
So you'd get something like this: