to find occurrence of a character in a string.....

#include"stdio.h"

int main()
{
char a[100],b;
int i = 0,n = 0,len = 0;
printf(“Enter The String Of Characters : “);
scanf(”%s”,a);
printf("\n\nEnter The Character You want to Count : “);
scanf(”%c",&b);

len = strlen(a);

fflush(stdin);

for(i = 0;i <= len;i++)
{
      if(b == a[i])
      {
              n++;        
      }      
}

printf("\n\nNumber Of Occurences of %c in %s is : %d",b,a,n);

getch();
return 0;   

}

//