I wrote a program assuming characters of all strings will be either smallcase or capitalcase. Please find the same as below:
void IndexMap(char *);
int output[26] = {0};
int main ()
{
int n;
int indx;
char string[n][255];
printf ("How many strings want to enter");
scanf("%d", &n);
/* Find common characters from all the entered stings */
for (indx = 0; indx < n; indx++)
{
printf("Enter %d string\n", indx+1);
scanf("%s", string[indx]);
IndexMap(string[indx]);
}
for (indx = 0; indx < 26; indx++)
{
if (output[indx] == n)
printf("Common character [%c] from all strings\n", 'a'+ indx);
}
return 0;
}
void IndexMap(char *string)
{
while (*string != '\0')
output[*string++ - 'a']++;
}
If any has better algorithm or program, please share.