Computer Science, asked by brijeshhkumar1980, 10 months ago

program in java for magic number testing​

Answers

Answered by ItZCutiEGiRl
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 SpanditaDas
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