Tuesday , December 6 2016
Home / Blue J / Java Program to check for a Magic Number

Java Program to check for a Magic Number

This is a Java program for Magic number. However before starting let me tell you what is a magic number.

A Magic number is a number whose sum of digits eventually leads to 1.
Example#1:  19 ;  1+9 =10 ; 1+0 = 1.  Hence a magic number.
Example#2:  226; 2+2+6=10; 1+0 =1.  Hence a magic number.
Example#3:  874; 8+7+4=19; 1+9=10; 1+0=1.  Hence a magic number.

ALSO CHECK: Java program to print the magic number series

OUTPUT:

java program for magic number
java program for magic number
 java program for magic number
Also See:   Java program for patterns and formats in java/bluej/c/c++

Check Also

Program for Matrix Multiplication in JAVA

Matrix Multiplication:– Here is given a Java Program for Matrix Multiplication also call matrix product. In ...

2 comments

  1. It was very helpful.

  2. It was very helpful

Leave a Reply

Your email address will not be published. Required fields are marked *

Preventing spam * Time limit is exhausted. Please reload the CAPTCHA.