What is Magic number? A number is said to be a magic number if that number sum of digits are calculated till a single digit recursively, So we can say that adding the sum of the digit after every summation and than the single digit come out to be 1, then the that number known as magic number. In this video lecture cover the not recursively logic but first take one while and one main very if decision statement condition with using logic and operator combine two condition in one if statement and again continue while loop again like recursively function call itself, and my user define function section also cover the recursively logic of that magic number program.
For example : 50113 5+0+1+1+3=10 1+0=1
1234 1+2+3+4 =10 1+0=1 640 6+4+0=10 1+0=1 352 3+5+2=10 1+0=1 all these number are magic numbers and apply UDF.
Download
0 formats
No download links available.
Magic Number using Recursive Sum of Digits in C++ Programming Language | NatokHD