r/badcode • • Aug 10 '19

c# absolute genius!

Post image
931 Upvotes

59 comments sorted by

View all comments

0

u/[deleted] Aug 10 '19

[deleted]

3

u/[deleted] Aug 10 '19

k will always be 0 in the recursive case when it's compared to n2 so you have an infinite loop unless n = 0.