The code you show us doesn't show the error you describe.
If I run your code through an online IDE:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int Luckynumbers[] = {6,4,98,97,106,54,54};
int i;
for(i=0; i<=5; i++)
{
printf("%d\n",Luckynumbers[i]);
}
return 0;
}
And run it, I get the expected output:
6
4
98
97
106
54
...Program finished with exit code 0
Press ENTER to exit console.
I suspect that you compiling the wrong file!