#include<stdio.h>
main()
{
char a[10];
char ch;
int i,count=0;
for(i=0;i<10;i++)
{
printf("enter the character in array a[%d]=",i);
scanf(" %c",&a[i]);
}
printf("enter the charcter u want to search:");
scanf(" %c",&ch);
for(i=0;i<10;i++)
{
if(a[i]==ch)
{
count++;
}
}
printf("number of occurance of your entered character is %d",count);
}
No comments:
Post a Comment