Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loop A: 1 to 10
- loop B: 1 to 5
- loop C: 1 to 7
- for each iteration of loop A, the loop counter would increase by 35 ( 5 * 7 )
- for each iteration of loop B, the loop counter would increase by 7 ( 7 * 1 )
- for each iteration of loop C, the loop counter would increase by 1
- if loop counter is 80
- 80 % 35 = 10
- (80 - 10) / 35 = 2 - loop A's iteration count
- 10 % 7 = 3
- (8 - 1) / 7 = 1 - loop B's iteration count
- loop C's interaction count 3 (innermost loop so mod not required)
Add Comment
Please, Sign In to add comment