It's an order of operations problem. Inside the loop, you're always testing the next pointer in temp, which is always uninitialized. Take some time to test out how for loops manage the counter variable, because a lot of code relies on that behavior and it's easy to write code that makes false assumptions like this one.
Here's an improved version:
int main(void)
{
char in[100], *temp[10];
int i, n = 0;
printf("Enter the expression: ");
fflush(stdout);
if (fgets(in, sizeof in, stdin) != NULL)
{
temp[0] = strtok(in, " ");
if (temp[0] != NULL)
{
for (n = 1; n < 10 && (temp[n] = strtok(NULL," ")) != NULL; n++)
;
}
for (i = 0; i < n; i++)
{
printf("%s\n", temp[i]);
}
}
return 0;
} Note the call to fgets (a vast improvement over the unsafe gets) and the fact that input is being tested for success or failure. Next is the loop. Instead of calling subsequent strtoks in the body, it's done in the condition where the condition can be checked before n is updated.
I used n in the first loop to indicate how many strings there are. You could also use NULL as long as temp is initialized to all NULLs first. The second loop uses n as the end case.
Another very important thing to notice is how the first loop also takes care not to exceed the size of temp if there are more than ten tokens. Noticing and covering for errors like this comes with experience, but you should always have an eye for failure points.