The 'Magic Eight Ball' trademark and various 8-Ball answers are used without permission of Mattel Inc. Is in no way affiliated with this web page, or with its proprieter, or with the 8 ball Twitter bot with which we are also associated. The purported magical powers of the Online Magic Eight Ball are in no way meant to imply. Any of the numbers, 2, 8, 20, 28, 50, 82, or 126, that represent the number of neutrons or protons in strongly bound and exceptionally stable atomic nuclei.
Learn how to Find Magic Number in C Programming. A Magic Integer is also known as Ramanujan’s Number. Find more about magic integers on Wikipedia. You must know how to Reverse the Digits of a Number and how to find the Sum of Digits of a Number to understand this program better.
Also known as Hardy-Ramanujan Number or Taxicab Number, it is an integer in which, when its digits are added, it produces a sum which, when multiplied by the its reversed number, fetches the original integer.
Must Read: C Program To Find if a Number is a Strong Integer or Not

81
8 + 1 = 9
9 × 9 = 81
1729
1 + 7 + 2 + 9 = 19
19 × 91 = 1729
Must Read: C Program To Find Sum of Two Complex Numbers
Note: This C Program To Print Magic Numbers has been compiled with GNU GCC Compiler and developed using gEdit Editor and Terminal in Linux Ubuntu Operating System.2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 | intreverse_digits(int); intmain() intsum,num,reverse; scanf('%d',&num); if(sum<10) if((sum *sum)num) printf('n%d is a Magic Integern',num); else printf('n%d is Not a Magic Integern',num); return0; reverse=reverse_digits(sum); { } { } } intsum_of_digits(intnum) intsum=0; { num=num/10; returnsum; { while(num>0) reverse=(reverse *10)+(num%10); } } |
Must Read: C Program To Check if Number is Narcissistic Number or Not
If you have any compilation errors or doubts in this code to find magic integers in c programming, let us know about it in the comment section below.