Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- int main()
- {
- char s[1000];
- int i, k, count=0, n, length;
- printf("Enter the string: ");
- gets(s);
- for(length=0;s[length];length++);
- n=length;
- for(i=0;i<n;i++)
- {
- count=1;
- if(s[i])
- {
- for(length=i+1;length<n;length++)
- {
- if(s[i]==s[length])
- {
- count++;
- s[length]='\0';
- }
- }
- printf("%c = %d \n",s[i],count);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement