Answer:
#include <stdio.h>
int main() {
char phrase[10];//declaring a string.
printf("Enter the phrase\n");
scanf("%[^\n]s",phrase);//taking a phrase as an input with spaces.
int a[256]={0};//count array.
for(int i=0;phrase[i]!='\0';i++)
{
a[phrase[i]]++;//updating the count.
}
for(int i=0;i<256;i++)
{
if(a[i]>1)//printing the characters having count greater than 1.
{
printf("%c ",i);
}
}
return 0;
}
Output:-
Enter the phrase
full proof
f l o
Explanation:
In the code written above I have declared a string phrase and then taking input from the user in the string phrase with white spaces.Then I have created a count array for the storing the frequency of the characters and then looping over the array a and if there any element is greater than 1 means frequency is greater than 1 then printing that character.