Armstrong number

#include<stdio.h>
int main()
{
int n,r,sum=0,temp;
printf(“enter the number = “);
scanf(”%d”,&n);
temp=n;
while(n>0)
{
r=n%10;
sum=sum+(rrr);
n=n/10;
}
if(temp==sum)
printf("TRUE ");
else
printf("FALSE ");
return 0;
}

This is my code …In online IDE my code is running but in contest its failing

Hey,
It seems its u are new to competitive programming, u dont not have to write print statements like

Also, in the armstrong number , first the number of digits need to be counted, if u are dealing with a 4 digit number u have to perform

abcd = pow(a,4)+ pow(b,4) + pow(c,4) + pow(d,4);
u could refernce the code below

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.