Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void countChar() {
- int count = 0;
- for (int i = 0; i < strlen(str); i++) {
- if (!str[i])
- continue;
- for (int j = i + 1; j < strlen(str); j++) {
- if (str[i] == str[j]) {
- count++;
- }
- }
- printf("\n %c occurs : %d times", str[i], count);
- count = 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement