When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
5 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
code
#include<conio.h>
int main()
{
int a , b[10] , r , i , sum=0 , j , temp;
printf("Enter a 4 digit Number =");
scanf("%d",&a);
temp = a;
for(i=0;i<4;i++)
{
r=temp%10;
b[i]= r;
temp=temp/10;
}
for(j=0;j<4;j++)
{
sum = sum + (b[j]*b[j]*b[j]);
printf("%d ",b[j]);
}
printf("%d",sum);
if(sum=a)
{
printf("The Number is an Armstrong Number");
}
else
{
printf("The number is Not an Armstrong Number");
}
return 0;
}```
!solver
!solved