Frequency of any Character in string | C Language | Beginners' code

preview_player
Показать описание
This video clear explains the way you will use C language to determine the Frequency of any character in a particular string.This is a basic and fundamental C program for beginners.
Рекомендации по теме
Комментарии
Автор

so whats the problem in this code

#include <stdio.h>
#include <stdlib.h>
char find(char a1[1000], char ch)
{

int i, flag=0;
for(i=0;a1[i]!='\0';i++)
if(ch==a1[i])
{
flag++;
}
printf("the number of freq for %c is %d ", ch, flag);
return flag;
}

int main()
{
char a1[1000];
char ch;
printf("enter your string:");
scanf("%s", a1);
printf("enter your character:");
scanf("%c", &ch);
find(a1, ch);
}

abdohanfi
Автор

in a string no of occurances of elemet how to store the finding element in array

-jp
welcome to shbcf.ru