Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
You're overflowing the bounds of int. Try using a bigger size variable. Like long. You're still going to overflow with the size of fib you're using, but you'll see the difference is that it happens much later in the output.
19th Feb 2021, 7:26 AM
ChaoticDawg
ChaoticDawg - avatar