'Function returns Initials of first and last names

I need help solving this problem in my mind so if anoyne had a similar problem it would help me.

The problem is: Create a function that forms and returns a string containing that person's initials in the form "P.I" based on the person's last name and first name (which are sent as separate strings) (P is the first letter of the last name and I is the first letter of the first name).

I tried this:

#include <stdio.h>
#include <string.h>

char function(char *s1,char *s2)
{
   char pom[100];
   pom[0]=s1[0];
   pom[1]='.';
   pom[2]=s2[0];
   pom[100]=pom[0]+pom[1]+pom[2];
   return pom;
}
int main()
{

   char s1[100];
   char s2[100];
   scanf("%s",s1);
   scanf("%s",s2);
   char pom[100];
   pom[100]=function(s1,s2);
   printf("%s",pom);

  return 0;
}

But this is not working properly.

Thanks in advance !

Best regards !



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source