Listening of Armstrong Number first of all comes what’s Armstrong number. Armstrong Number is a special number that is equal to sum of cubes of its own digits for example 153 , 407 and so on…
C Language is Basic Language .. Many Advanced Language have come still if u can understand basic language carefully u can do all other languages in easy way. So here is our efforts of giving programs which are well executed in our Rubal Solutions Server and confirm to be running successfully. we have our c programming full tutorial on rubal solutions you tube channel. u can learn theory and practical’s from there … ask any queries if needed.
Let’s Check
153 = (1*1*1)+(5*5*5)+(3*3*3)
where:
(1*1*1)=1
(5*5*5)=125
(3*3*3)=27
So:
1+125+27=153
#include <stdio.h>
int main()
{
printf("Welcome to Rubal Solutions\n\n");
printf("Do Like Comment Share and Subscribe To Our Youtube Channel\n\n");
int n,r,sum=0,temp;
printf("enter the number=");
scanf("%d",&n);
temp=n;
while(n>0)
{
r=n%10;
sum=sum+(r*r*r);
n=n/10;
}
if(temp==sum)
printf("%d is armstrong number",temp);
else
printf("%d is not armstrong number",temp);
return 0;
}
1,431 total views, 2 views today
No Responses