c code problem in strings....pls help..!!!!
#include <stdio.h>
#include<conio.h>
void str(char *a,char *b);
char z[15];
int main() {
char a[15];
char b[15];
printf("enter string 1: ");
scanf("%s",a);
printf("enter string 2: ");
scanf("%s",b);
str(a,b); printf("%s",z);
}
void str(char *x,char *y) {
int i=0,leny=0,count=0;
char *p;
p=y;
while(*y!='\0')
{
leny++; y++;
}
while(*x!='\0')
{
y=p;
while(*y!='\0')
{
if(*x!=*y)
{
y++; count++;
}
else
{
break;
}
if(count==(leny+1))
{
z[I]=*x;[/I]
[I] i++; [/I]
[I]break;[/I]
[I] }[/I]
[I] }[/I]
[I] x++;[/I]
[I] }[/I]
[I] }[/I]