Help me please!!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help me please!!!

*Multiples* You need to calculate the sum of all the multiples of 3 or 5 below a given number. Task: Given an integer number, output the sum of all the multiples of 3 and 5 below that number. If a number is a multiple of both, 3 and 5, it should appear in the sum only once. Input Format: An integer. Output Format: An integer, representing the sum of all the multiples of 3 and 5 below the given input. Sample Input: 10 Sample Output: 23 I cannot understand the format or even how to do the code. Help please!!!!

6th May 2024, 10:08 AM
Srinjan
3 Answers
+ 1
Can you calculate the same result as the sample output by hand? If you can, try to write down the steps how you calculated it. Then, think about how to translate these steps into Java code. From your profile, it seems you started both Java Introduction and Intermediate. Concentrate on the Introduction first and study the programming basic. The introduction course covers the techniques you need to solve this problem.
6th May 2024, 11:06 AM
Wong Hei Ming
Wong Hei Ming - avatar
0
No sir I have not started Java Intermediate. My profile is showing that just because I viewed the course
6th May 2024, 11:15 AM
Srinjan
0
Thank you for helping me
6th May 2024, 11:16 AM
Srinjan