Computer Science, asked by nancyyy, 1 year ago

What is a 'magic number' in computer programming languages.
Explain along with an example of such number.

Answers

Answered by vihaan33
1
A number is said to be a magic number if the sum of digit is obtained by recursively adding the sum of its digits. If the signal digit come to be one then the number is a magical number.
Example - 199 is a magic number as 1+9+9=19 but 19 is not a single digit number so 1+9=10 and then 1+0=1 which is the signal digit number and also 1 . Hence it is a magical number.

nancyyy: I'm sorry..But No more unnecessary comments out here! thanks^^"
DaIncredible: @Mayank, no more unnecessary commments, you wished cozz of her birthday. And we didnt asked you with her, did we ??
nancyyy: look..when the other person is being polite..you too have to do the same..If you are willing to violate rules then I'm sorry but your account will be deleted eventually :/ Bye!
Answered by beauti1new2016
0

Magic numbers are special value of certain variables which causes the program to behave in an special manner. For example, a communication library might take a Timeout parameter and it can define the magic number "-1" for indicating infinite timeout.

Similar questions