Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  c
Language: C/C++
Code:
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main
{
int i,count;
char str[50],ch;
printf("enter the string");
gets(str);
printf("enter character to be searched");
ch=getchar();
for(i=0;str[i]!='0';i++)
{
if(str[i]==ch)
count++;
}
if (count>0)
printf("character %s occurs %d times",ch,count);
else printf("character does not occur);
getch();

          
          
Comments: