Skip to content

Instantly share code, notes, and snippets.

@arrbxr
Created February 21, 2018 02:41
Show Gist options
  • Select an option

  • Save arrbxr/7716afe6af59e85c3d875612a4080d00 to your computer and use it in GitHub Desktop.

Select an option

Save arrbxr/7716afe6af59e85c3d875612a4080d00 to your computer and use it in GitHub Desktop.
Armstrong Number created by arrbxr - https://repl.it/@arrbxr/Armstrong-Number
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