Program to check a number is armstrong or not
CodeChefOpen on judge ↗
Program to check a number is armstrong or not. #include int main() { int num ,n,n1,c=0,mul=1,sum=1,r,f,i; scanf("%d",&num); n=num; n1=num; while(n!=0) { r=n%10; c++; n=n/10; } while (num!=0) { f=num%10; mul=1; for(i=1;i<=c;i++) { mul=mul*f; } sum=sum+sum; num=num/10; } if(n1==sum); printf("Armstrong Number"); else printf("Not an Armstrong Number"
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start