i don't understand what's wrong. it ran without any problem & the output is also correct.so why RuntimeError
#include<stdio.h>
int main(void)
{
unsigned long a,b,i,c,num[1000],u,sum=0;
scanf("%lu",&c);
for(i=0;i<c;i++) scanf("%ld",&num[i]);
for(i=0;i<c;i++) {
u=num[i];
do{
sum=0;
a=num[i];
b=a%10;
sum=sum+(b*b);
a=a/10;
while(a!=0){
b=a%10;
sum=sum+(b*b);
a=a/10;
}
num[i]=sum;
}while(num[i] / 10 != 0);
if(sum==1) printf("Case #%lu: %lu is a Happy number.\n",i+1,u);
else printf("Case #%lu: %lu is a Unhappy number.\n",i+1,u);
}
return 0;
}
