We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68c9cd1 commit eb9a030Copy full SHA for eb9a030
1 file changed
Armstrong number
@@ -0,0 +1,18 @@
1
+Thank you bro!Just subscribed to your channel!
2
+class ArmstrongExample{
3
+ public static void main(String[] args) {
4
+ int c=0,a,temp;
5
+ int n=153;//It is the number to check armstrong
6
+ temp=n;
7
+ while(n>0)
8
+ {
9
+ a=n%10;
10
+ n=n/10;
11
+ c=c+(a*a*a);
12
+ }
13
+ if(temp==c)
14
+ System.out.println("armstrong number");
15
+ else
16
+ System.out.println("Not armstrong number");
17
18
+}
0 commit comments