#include<stdio.h>
void main()
{
char n[]="helllo",c={'a'};
char *p=&n[0];
int len=0;
clrscr();
while(*p!='\0')
{ if(*p==c)
len++;
p++;
}
if(len==0)
{ printf("No Match Found...");
}
else
{ printf("No of Char Match: %d",len);
}
getch();
}
void main()
{
char n[]="helllo",c={'a'};
char *p=&n[0];
int len=0;
clrscr();
while(*p!='\0')
{ if(*p==c)
len++;
p++;
}
if(len==0)
{ printf("No Match Found...");
}
else
{ printf("No of Char Match: %d",len);
}
getch();
}
No comments:
Post a Comment