My issue
include <stdio.h>
int main() {
int n;
int r,z,x=0;
scanf(“%d”,&n);
z=n;
while(n>0)
{
r=n%10;
x=x+r*r*r;
n=n/10;
}
if(z==x)
printf(“Armstrong”);
else
printf(“not Armstrong”);
}
whts the error
My code
#include <stdio.h>
int main() {
int n;
int r,z,x=0;
scanf("%d",&n);
z=n;
while(n>0)
{
r=n%10;
x=x+r*r*r;
n=n/10;
}
if(z==x)
printf("Armstrong");
else
printf("not Armstrong");
}
Learning course: Algorithmic Problem Solving
Problem Link: https://www.codechef.com/learn/course/klu-problem-solving/KLUPS00A/problems/LPYAS151