Checking Armstrong Number in CLocked
I’m trying to check whether or not the number provided by the user is an Armstrong number in C. Something is wrong though and I can’t figure it out.
Any help is appreciated.
Code attached below.
printf(“enter the number you want to identify is aN ARMSTRONG OR NOT:”);
for(int i=1 ; i<=3 ; i++)
b = a % 10;
x = fun(b);
y = x+y;
a = a/10;
printf(“\nnot an armstrong number”);
int fun(int x)