Learning To Code #7 (Loops)
Sum of many numbers. (Exercise for beginners)
- Make a loop that will ask the user for a number. Stop the loop if the user's input is 0.
- int sum = 0; Add the user's number to the sum until the user's input is 0.
Here is an example of how it should work.
This exercise seems to be easy but it's actually not that easy if you haven't heard anything about loops. I recommend learning loops. Once they will be your best friends, especially 'for' loop. In this exercise, you can use 'while' loop which seems easier but at the end of the day I highly recommend you to learn more about 'for' loops.
Unfortunately, I haven't got any time to code right now as I got so much to do off PC. Tomorrow will be a free day for me and then I will dive into learning again.
If you got any questions feel free to hit me up!🤓
Peace!✌️
Leave Learning To Code #7 (Loops) to:
Read more #coding posts
Best Posts From steify
We have not curated any of steify's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From steify
- Things Didn't Go As Planned.
- Learning To Code #8 (ArrayList)
- New Project (MP3 Player) #1
- Learning To Code #7 (Loops)
- Learning To Code #6 (Number Guessing Game)
- Learning To Code #5
- How To Learn Coding
- Learning To Code #4 (Array exercise + Chart progress)
- Learning To Code #3
- Learning To Code #2
- Learning To Code #1
- Personal Sneaker Investments.📈 part 1.
- Air Jordan 11 Cool Grey.
- Air Jordan 5 Raging Bull.
- Nike Dunk Low Medium Curry.
- Air Jordan 11 Low IE Bred.
- Supreme/Nike SB Dunk Low.
- The Air Jordan 12 Twist.
- Nike Dunk Low PRM Medium Curry.
- Create your own Nike Dunk Low.