Magic Number Or Not? Find out in Java
What is a Magic Number? A number is said to be a magic number, if the sum of its digits are calculated till a single digit recursively by adding the sum of the digits after every addition. If the single digit comes out to be 1,then the number is a magic number. Answer: import java . util . Scanner ; public class MagicNumber { public static void main ( String [] args ) { Scanner sc = new Scanner ( System . in ); System . out . println ( "Enter the number to check magic number or not" ); int n = sc . nextInt (); if ( n % 9 == 1 ){ System . out . ...