why the code doesn't work?? anything wrong with that loop?? if then what should be answer? and why it can't be. Please make me clear. :)
#include<stdio.h>
#include<string.h>
int main()
{
char s[1000];
int i,j=1,x,y; char k,l;
gets(s);
l = strlen(s);
scanf("%c",&k);
for(s[i]=0; s[i]<l; i++)
{
if(s[i]=='k')
j++;
}
printf("\n%c is %d time(s) in string",k,j);
return 0;
}