menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Register
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
Consider the recursive method myprint in this code snippet: public void myprint(int n) { if (n < 10) { system.out.print(n); } else { int m = n % 10; system.out.print(m); myprint(n / 10); } } what is printed for the call myprint(821)?
asked
May 7, 2018
67.6k
views
0
votes
Consider the recursive method myprint in this code snippet: public void myprint(int n) { if (n < 10) { system.out.print(n); } else { int m = n % 10; system.out.print(m); myprint(n / 10); } } what is printed for the call myprint(821)?
Computers and Technology
college
Celso Wellington
asked
by
Celso Wellington
8.0k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
6
votes
What the method does, is it takes the rightmost decade and prints it, then divides by 10 and repeats. Effectively this means the number is printed backwards, so the output is 128.
Przemyslaw
answered
May 11, 2018
by
Przemyslaw
8.0k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.5m
questions
12.2m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
Seven basic internal components found in a computer tower
Please help me ! All you do is just put it it all in your own words ! Please this is for my reported card!i don't know how to put it in my own words because my English is not that good!
Disadvantages of using animation in advertising? advantages and disadvantages of using animation for education? advantages and disadvantages of using animation in entertainment?
Explain why binary codes are used to represent characters, numbers and symbols :)
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org