Don't know why 345555 passes through, it is certainly divisible by 5. Compiler bug perhaps? What compiler are you using?
Did you try printing the number entered back on screen to check the variable contains the expected value?
Paste the following function into your code, call it, and let me know what the output was:
for (int i=0; i<7; i++)
if (num[i]%5==0 || num[i]%2==0)
printf("%d is divisible by 2 or 5\n",num[i]);
Obviously this shouldn't say anything for 3 or 7, but the rest should print "is divisible by 2 or 5".