Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit abeae5b

Browse files
authored
Update and rename Armstrong.java to Arm
1 parent b5e9913 commit abeae5b

File tree

1 file changed

+5
-8
lines changed
  • contributors/Harshit1020

1 file changed

+5
-8
lines changed

contributors/Harshit1020/Armstrong.java renamed to contributors/Harshit1020/Arm

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
import java.util.Scanner;
2-
31
public class ArmstrongNum {
42
public static void main(String[] args) {
5-
int n;
6-
Scanner sc = new Scanner(System.in);
7-
System.out.println("enter the value:");
8-
n = sc.nextInt();
3+
int n = 153;
94
int temp = n;
105
int rem, sum =0;
116
while(n >0){
@@ -14,10 +9,12 @@ public static void main(String[] args) {
149
sum = sum+(rem*rem*rem);
1510
n = n/10;
1611
}
17-
if(temp == sum){
12+
if(temp == sum)
13+
{
1814
System.out.println("number is armstrong");
1915
}
20-
else{
16+
else
17+
{
2118
System.out.println("number is not armstrong");
2219
}
2320
}

0 commit comments

Comments
 (0)