Check if a number is magic ( Recursive sum of digits is 1 ) | C ++ program to check Whether the number is Magic or not . ; Accepting sample input ; Condition to check Magic number
#include <iostream> NEW_LINE using namespace std ; int main ( ) { int x = 1234 ; if ( x % 9 == 1 ) cout << ( " Magic ▁ Number " ) ; else cout << ( " Not ▁ a ▁ Magic ▁ Number " ) ; return 0 ; }