We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c5a558 commit 35e3841Copy full SHA for 35e3841
Armstrong.c
@@ -0,0 +1,25 @@
1
+#include<stdio.h>
2
+#include<math.h>
3
+int main() {
4
+int n,d=0,r,s=0,t;
5
+printf("Enter a no- ");
6
+scanf("%d",&n);
7
+t=n;
8
+while (n>0)
9
+{
10
+ n=n/10;
11
+ d=d+1;
12
+} n=t;
13
14
15
+ r=n%10;
16
+ printf("%d", d);
17
+ s=s+pow(r,d);
18
19
20
+if (n==s)
21
22
+ printf("in %d is Armstrong",n);
23
+} else
24
+ printf("in %d is not Armstrong",n);
25
+}
0 commit comments