Ask your own question, for FREE!
Computer Science 6 Online
OpenStudy (cavazos_899579):

I need help here.So I need to complete GettingIndividualDigits assignment and need some help to get my code to work. Here is my code: public class GettingIndividualDigits { public static void main( String[] args ) { int sum; for ( int dn1 = 10 ; dn1<= 99 ; dn1++ ) { for ( int dn2 = 1 ; dn2<= 9 ; dn2++ ) { // two loops, one for the tens place, and one for the ones place // CREATE dn1 OUT OF dn2 and dn3 System.out.println(dn1 + ", " + dn2 + "+" + dn3 + " = " + sum); } } } } } So I need to make two loops one for tens and one for ones and need~

OpenStudy (sparrow2):

what is the question?

OpenStudy (onepieceftw):

This is a nested loops question? The inside loop turns over faster so the ones place will be on the inside. Every time it comes to 9 the tens place will be incremented.

OpenStudy (rsmith6559):

If you're looking to split a number like 123 into 1, 2 and 3, that's a recursive problem, not one that uses loops.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Mari103: How to pop out like a Jacc In the box
7 hours ago 0 Replies 0 Medals
Breathless: Spooky witch but cute
14 hours ago 3 Replies 0 Medals
Arriyanalol: help
14 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 4 Medals
Jaded012023: Please tell me what you all think of this song
17 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
17 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!