Check if a number is magic ( Recursive sum of digits is 1 ) | Java program to check Whether the number is Magic or not . ; Accepting sample input ; Condition to check Magic number
class GFG { public static void main ( String [ ] args ) { int x = 1234 ; if ( x % 9 == 1 ) System . out . printf ( " Magic ▁ Number " ) ; else System . out . printf ( " Not ▁ a ▁ Magic ▁ Number " ) ; } }