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

Commit e63558a

Browse files
authored
Update Armstrong.java
1 parent 3f2b99f commit e63558a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import java.util.Scanner;
2-
32
public class ArmstrongNum {
43
public static void main(String[] args) {
54
int n;
65
Scanner sc = new Scanner(System.in);
76
System.out.println("enter the value:");
87
n = sc.nextInt();
98
int temp = n;
10-
int rem, sum =0;
11-
while(n >0){
9+
int rem, sum = 0;
10+
while(n > 0){
1211

1312
rem = n%10;
1413
sum = sum+(rem*rem*rem);
@@ -18,7 +17,7 @@ public static void main(String[] args) {
1817
System.out.println("number is armstrong");
1918
}
2019
else{
21-
System.out.println("number is not armstrong");
22-
}
20+
System.out.println("number is not armstrong")
21+
}
2322
}
2423
}

0 commit comments

Comments
 (0)