Start by sorting out your indentation, so your code is easier to read, and getting rid of redundant comments (which is all of them). Comment what the code is doing, not what the actual instructions are, we can read those...
int main()
{
int a[10],i,num;
printf("enter the size of array");
scanf("%d",&num);
printf("enter the elements");
for(i=0;i<num;i++)
{
scanf("%d",&a[i]);
}
printf("the entered array is ");
for(i=0;i<num;i++)
{
printf("%d",a[i]);
}
prime_num(num,a[10]);
}
Then, start working out what is wrong with your code.
Start by looking at what you are entering: what is the value of
num
for example? If it's bigger than 10, you have a problem, because you only allowed for 10 values to be entered. You should check that, and reject values which won't fit (because if you don't, your app will crash when your user enters a "bad" value).
The next thing to do is to look at your
prime_num
function. What exactly are you passing to it? Is it an array, or a single element?
Hint: What does [10] do if you put it after an array, specifically an array of ten elements?