Quote:But when integers are more than 7 or 8 numbers each this code executes a garbage value.
Look at your code:
int x[size], y[size], a[size], xa[size], ya[size], num[size];
So you allocate 6 arrays, all one gigabyte times the size of an integer, and then read a single value into the first element of each.
Then you try to check if one array is completely divisible by another ...
What part of that doesn't seem strange to you?
When you declare an array, the name of the array is a pointer to the first element; these two staments are equivelent:
int * px = x;
int * px = &(x);
Which means that your code is attempting to divide a pointer by another pointer - and you can't do that because it's like trying to divide your mobile phone number mby my mobile phone number: it may be possible to a value of some kind, but it will have no meaning, it is useless for any practical purposes whatsoever.
And taking the address of an array is pointless, as it returns the same pointer value:
Stop and think about what you are actually trying to do: about what the problem you were having with the earlier version might be related to instead of randomly adding code to bodge round your lack of understanding.
If you were getting weird results from "big numbers" when you input them, the most likely reason is that an integer is not big enough: depending on your compiler, an integer could be 16, 24, or 32 bits - which can hold positive number up to 32768, 8388608, and 2147483648 respectively.
Changing to an array won't help that: the size of an integer doesn't change no matter how many of them you allocate, and you can't read a number "across elements" of an array.