c program to the count the number of times each character appears
#include <stdio.h>
int main() {
char str[1000], ch;
int count = 0;
printf("Enter a string: ");
fgets(str, sizeof(str), stdin);
printf("Enter a character to find its frequency: ");
scanf("%c", &ch);
for (int i = 0; str[i] != '\0'; ++i) {
if (ch == str[i])
++count;
}
printf("Frequency of %c = %d", ch, count);
return 0;
}
Also in C:
- division recursiva
- c check if char is number
- liste chainée c
- c math.h sqrt
- router solicitation and advertisement magic is used by
- code in c skipping over scanf
- hello world program
- how to make a debug in c
- what is strikethrough in markdown
- how to mutex lock in c
- obby übersetzung
- c \b
- declaration in c
- declare character array statically?
- int to double c
- modelform prefill with data
- strtok
- read a binary file c
- BlockChain in c
- command line arguments c
- arm-linux-gnueabihf-gcc: error: unrecognized argument in option '-mfpu=neon-vfpv3'
- vue cdn
- celsius to fahrenheit formula
- arduino remove()