Created
February 21, 2018 02:41
-
-
Save arrbxr/7716afe6af59e85c3d875612a4080d00 to your computer and use it in GitHub Desktop.
Armstrong Number created by arrbxr - https://repl.it/@arrbxr/Armstrong-Number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Main { | |
| public static void main(String[] args) { | |
| int num = 153, arm = 0, i, temp; | |
| temp = num; | |
| while(num != 0){ | |
| i = num%10; | |
| arm = arm + i*i*i; | |
| num /=10; | |
| } | |
| if(arm == temp){ | |
| System.out.println("It is arm no"); | |
| } | |
| else | |
| System.out.println("it is not prime no"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment