Quote:
But when integers are more than 7 or 8 numbers each this code executes a garbage value.
Look at your code:
int size=1000000000000;
int x[size], y[size], a[size], xa[size], ya[size], num[size];
scanf("%d%d%d", &x,&y,&a);
if( x%a!=0){
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 x[100];
int * px = x;
int x[100];
int * px = &(x[0]);
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:
int a[10];
printf("%p:%p\n",a, &a);
0x7ffcce8972a0:0x7ffcce8972a0
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.