program in java for magic number testing
Answers
Answered by
2
- Enter any number : 145.
- 145 is a Magic number. Another way of checking whether a given number is Magic number or not is given below.
- import java.util.*; public class JavaHungry { public static void main(String args[]) { System. out. println("Enter any number : "); Scanner scan = new Scanner(System.
Answered by
0
Answer:
A Magic number is a number whose sum of its digits are calculated till a single digit is obtained by recursively adding the sum of its digits. If single digit obtained is 1, then the number is magic number, otherwise not.
Hope the answer will help you plz mark it as the brainliest answer.
Similar questions
Computer Science,
5 months ago
Chemistry,
5 months ago
Hindi,
10 months ago
Math,
10 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago