int main(int argc, const char * argv[]) {
int n=153,sum=0,temp,ans;
temp=n;
while (temp!=0) {
ans=temp%10;
sum=sum+ans*ans*ans;
temp=temp/10;
}
if (sum==n) {
NSLog(@"armStrong Value");
} else {
NSLog(@"not armStrong Value");
}
return 0;
}
Sign up here with your email
ConversionConversion EmoticonEmoticon