0

I need helpđŸ„șUse do while loop in Java

Use do while loop Create a program that reads 10 integers, and then prints the sum of even and odd integers. I need help guys I've been trying for many hours. Thank you.đŸ„ș I want to accept 10 integers and add the all even and odd integers but it keeps asking more than 10 numbers ps: I am new to java and still learning. Thank you. https://code.sololearn.com/cWxEu2v8KiTu/?ref=app

21st Apr 2022, 7:26 AM
raf
raf - avatar
6 Answers
+ 2
Link your code by editing the above message. Post stating you did it.
21st Apr 2022, 7:29 AM
John Wells
John Wells - avatar
+ 1
If you have been trying, you can show us what you have tried, right? Go to Code section, click +, select Java, insert your code there, save. Then come to this thread, click +, Insert Code, sort for My Code Bits, select your code.
21st Apr 2022, 7:36 AM
Lisa
Lisa - avatar
0
thank your sir hope you can help me Ive been trying for so many hours and I cant do it😔
21st Apr 2022, 7:35 AM
raf
raf - avatar
0
okay maam sorry I am new to this platform thank you.
21st Apr 2022, 7:42 AM
raf
raf - avatar
0
It would be really helpful if your code script had some indentation. You need to initialize num with 10 for getting 10 number inputs. Create the scanner object only once BEFORE the loop. Print the sums only once AFTER the loop. do-while loops are explained in lesson 18 of the sololearn Java course in case you need to to re-vise
21st Apr 2022, 7:48 AM
Lisa
Lisa - avatar
0
Thank you so much maam Lisa for your advice I made it.
21st Apr 2022, 9:36 AM
raf
raf - avatar