Computer Science, asked by shadabfarid8, 8 months ago

write a program to input a number and check whether it is a magic number or not. A number is said to be a magic number if the sum of the digits are calculated till a single digit is obtained by repeatedly adding the sum of its digits . If the single digit comes to be 1 then the number is a magic number.................THANK YOU EVERYONE FOR HELPING ME TOO MUCH..............​

Answers

Answered by raghuramansbi
1

Explanation:

If the single digit comes to be 1 then the number is a magic number. Example- 199 is a magic number as 1+9+9=19 but 19 is not a sigle digit number so 1+9=10 and then 1+0=1 which is a single digit number and also 1. Hence it is a magic number

Similar questions