https://play.golang.org/p/oPTSePAAHNj
When I run this program, I don’t know where 45 comes from. Because the sum of the numbers is 44
https://play.golang.org/p/oPTSePAAHNj
When I run this program, I don’t know where 45 comes from. Because the sum of the numbers is 44
Oh gosh ! LOL You’re right! How did I screw that up??? I guess I better go back to 3rd grade!
When you encounter a problem like this, it often helps a lot to do the math on a calculator, and re-read your code to see exactly what is happening.
Computers are just calculators and tools, and they do not make math mistakes. If a result isn’t what you expect, you either have a code problem or a user problem
Lol. Hey thanks. Good advice
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.