Hey , in this "mini-proj" i should have make an Lucky ticket checker..

all work fine. except one thing . when i put "0" in the start of the number it calculate me a different Sum of numbers. youll see it if you tryin to Compile and run the Code. if some one can check mine incorrect itll be a pleasure thank you!

Code:

/*
#include<stdio.h>
int isLuckyNumber(int number);
int sumDigit(int number);
int sumEvenNumber(int number);
int totalLuckyTicket();
int main()
{
int number = 023232;
int piterLucky = isLuckyNumber(number);
if(piterLucky==1)
{
printf("Number %d is LuckyTicket\n",number);
}
else
{
printf("Number %d is NOT LuckyTicket\n",number);
}
printf("There is %d Of lucky Tickets.",totalLuckyTicket());
return 0;
}
int isLuckyNumber(int number)
{
int sumDig = sumDigit(number);
int sumEvenNum = sumEvenNumber(number);
if(sumDig==sumEvenNum*2)
{
return 1;
}
else
{
return 0;
}
}
int sumDigit(int number)
{
int res = 0;
for(; number!=0 ; number /= 10)
{
res = res+number%10;
}
return res;
}
int sumEvenNumber(int number)
{
int sumE=0;
for(; number!=0; number /= 10)
{
if((number%10)%2==0)
{
sumE = sumE + number%10;
}
}
return sumE;
}
int totalLuckyTicket()
{
int count=0;
int x;
for(x=1 ; x<=999999 ; x++)
{
if(isLuckyNumber(x)==1)
{
count++;
}
}
return count;
}

Im kinda of sure the problem is in this Part :

Code:

int sumDigit(int number){
int res = 0;
for(; number!=0 ; (number = number/10))
{
res = res+number%10;
}
return res;
}

for example to understanding more : when i put int number = 023232 it will change the whole number to "9889" . but when i put 232320 it will print the right number . thats what im tryin to fix !