0
I need help
I am a beginner and I have a homework i have to write a java program that sums all the multiple of 3 numbers from 3 to 33 using while loop but i don't know what am i supposed to do please help
3 Answers
+ 2
Try to sketch a code based on my hint, I or others here will help you out when there's a code in progress : )
+ 1
First you setup a variable to hold the sum of the desired numbers, initialize its value by zero. Let's just name the variable <sum>
Next, setup the while...loop, test and ensure it runs from 3 through 33. Let the loop counter variable be named <i>, initialize <i> by 3, and adjust the loop to run while <i> is less than or equal to 33.
Inside the loop, make sure you add the value of <i> to <sum> on each iteration, and increment <i> by 3.
Let's start with that, we'll talk again when you have implemented the idea in a code bit. Share a link to the code bit on this post so people can review it, and suggest as necessary, to guide you.
https://www.sololearn.com/post/75089/?ref=app
0
Sorry i don't get it can you make an example?