Are you trying to implement the string version of insertion sort?
If so I'd suggest using pointers to strings instead of a 2d array. It'd save costly processing time by eliminating calls to strcpy(), as you can re-direct pointers to the desired sort order. And below is your modified code, although it lacks some good-to-have features:
Code:
#include <stdio.h>
#include <string.h>
int main(void)
{
char s[100][20];
char temp[20];
int i, j, num;
printf("Enter total elements: ");
scanf("%d", &num);
printf("\nEnter any num strings : ");
for (i = 0; i < num; i++) {
scanf("%s", s[i]);
for (j = i; j > 1; j--)
if (strcmp(s[j], s[j-1]) < 0) {
strcpy(temp, s[j]);
strcpy(s[j], s[j-1]);
strcpy(s[j-1], temp);
}
}
printf("\nStrings in order are : ");
for (i = 0; i < num; i++)
printf("\n%s", s[i]);
return 0;
}