Try this, i changed a few things mainly i removed scanf and replaced it with fgets and sscanf, they're safer to use.
I also used pointers as they are less messy than a load of square brackets, enjoy.
Code:
#include <stdio.h>
void strins(char *str_ptr, char ch, int pos);
int main()
{
char string[31], temp[5], ch;
int pos;
printf("\nEnter a string ");
fgets(string, sizeof(string) - 1, stdin);
printf("\nEnter letter and position of correction ");
fgets(temp, sizeof(temp) - 1, stdin);
sscanf(temp, "%c %d", &ch, &pos);
strins(string, ch, pos);
return 0;
}
void strins(char *str_ptr, char ch, int pos)
{
str_ptr += (pos - 1);
*str_ptr = ch;
str_ptr -= (pos - 1); /* reset pointer */
puts(str_ptr);
return;
}