You are printing the wrong output.
Code:
if(sum==n1)
printf("angstrom");
else
printf("not angstrom");
It should be armstrong number and not angstrom. For those who dont know what it is.
Armstrong number: An n-digit number equal to the sum of the nth powers of its digits.
There are no two-digit Armstrong numbers; and there are four three-digit Armstrong numbers: 153, 370, 371, and 407.
1x1x1 + 5x5x5 + 3x3x3 = 153