- Define two strings called str1 and str2. Your strings can be of any length, but the last position in the string is fixed for the null character \0:
char str1[80],str2[80];
- Enter characters to be assigned to str1. The characters will be assigned to the respective index locations of the string, beginning with str1[0]:
printf("Enter a string: ");scanf("%s",str1);
- Compute the length of str1 using the strlen library function. Here, the first character of str1 is assigned to str2:
n=strlen(str1);str2[0]=str1[0];
- Use a for loop to access all of the characters of str1 one by one and pass them to the ifexists function to check whether that character already exists in str2. If the character is found in str2, this means it is the ...