-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArmstrong.c
More file actions
25 lines (20 loc) · 724 Bytes
/
Armstrong.c
File metadata and controls
25 lines (20 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<stdio.h>
int main()
{
int sum=0,number;
int remainder,temp;
printf("Enter Any Positive Number :");
scanf("%d",&number);
temp=number;
while(temp!=0)
{
remainder=temp%10;
sum=sum+remainder*remainder*remainder;
temp/=10;
}
if(sum==number)
printf("Armstrong Number\n");
else
printf("Not an Armstrong number\n");
return 0;
}