Smells like homework and of course the code you pasted wouldn’t even compile, but
- print #1 – once
- print #2 & #4 – 4 times, as the block is run once on each CPU
- “print #” (in the
for
) – 40 times, if you have40
CPUs, once on each, if you have4
, then 10 times on each
Is this tricky homework?
2
solved How many times will each print statement be executed? [closed]