Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Problem: Single_digit
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int sum = 11; int input = 9223; while ( sum > 10){ sum = 0; while (input != 0){ sum = sum+ (input%10); input = input/10; } if (sum >= 10) input = sum; } System.out.println(sum); } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Num ways to decode a string -Facebook interview
Java messing around
ex25
Armstrong number
3.A
Strings with same letters with reps
Two Sum in Sorted input array
bookstore
reserve array value
bubble sort
stackse - search stackoverflow differently
Please log in to post a comment.