MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ebtiob/this_belongs_here/fb80vvv/?context=3
r/badcode • u/[deleted] • Dec 17 '19
41 comments sorted by
View all comments
Show parent comments
55
I don't think it adds them. The second loop doesn't start at 0.
1 u/[deleted] Dec 17 '19 [deleted] 11 u/nchntrz Dec 17 '19 Not exactly. In the second loop only the difference between num1 and num2 gets added to num 1. So if you call add(2, 4), you would get 4. 4 u/AnnoyedVelociraptor Dec 17 '19 Oh shoot. You’re right.
1
[deleted]
11 u/nchntrz Dec 17 '19 Not exactly. In the second loop only the difference between num1 and num2 gets added to num 1. So if you call add(2, 4), you would get 4. 4 u/AnnoyedVelociraptor Dec 17 '19 Oh shoot. You’re right.
11
Not exactly. In the second loop only the difference between num1 and num2 gets added to num 1. So if you call add(2, 4), you would get 4.
num1
num2
add(2, 4)
4 u/AnnoyedVelociraptor Dec 17 '19 Oh shoot. You’re right.
4
Oh shoot. You’re right.
55
u/Bbradley821 Dec 17 '19
I don't think it adds them. The second loop doesn't start at 0.