Back to Browse

Magic Number in Java | Important Program in java

2.8K views
Oct 17, 2021
17:33

Magic Number Magic Number in Java Magic Number in Java | Important Program in java Magic Number in Java | ICSE Computer | Important Program in java Magic Number : A number is said to be a magic number, if the sum of its digits are calculated till a single digit recursively by adding the sum of the digits after every addition. If the single digit comes out to be 1,then the number is a magic number. Example : Number= 199 199=1+9+9=19 19=1+9=10 10=1+0=1 1 This is a Magic Number Input : 199 Output : Magic Number : 199 Input : 176 Output : Not Magic Number : 176 #java #programming #bluej #magicNumber ***************************************************************************** #VIdeo_Credit : Shashi Mauli Tripathi ***************************************************************************** #eclipse #eclipseide #java #bluej #numberSystem #javalearn #student #btech #teacher #beginners #programming #numbers #coder #javalearn #online #learnjava #tutorials #bestjavatraining #training #programming #video #virals #reversenumber #youtube #facebook Write a program to input a number and check whether it is 'Magic Number' or not. Display the message accordingly. A number is said to be a magic number if the eventual sum of digits of the number is one. Sample Input : 55 Then, 5 + 5 = 10, 1 + 0 = 1 Sample Output: Hence, 55 is a Magic Number. Similarly, 199 is a Magic Number.

Download

1 formats

Video Formats

360pmp423.9 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Magic Number in Java | Important Program in java | NatokHD