Find string in string
I trying to write function that searching string in some string.
exmaple:
"qwerty" => key to search
"qasazqertyqwerty"
the program return 1 because qwerty found in the string.

my code function is:

    int normal(char *str, char *str2)
    {
    	int temp=0;
    	while(*str)
    	{
    		while(*str2)
    		{
    			if(*str == *str2)
    			{
    				temp+=1;
    			}
    			else if(temp == strlen(str2))
    			{
    				printf("%d", temp/strlen(str2));
    			}
    			str2++;
    			str++;
    		}
    	}
    return 0;
    }

What the hell the problem in the program(logically)?
Find string in string
===

I trying to write function that searching string in some string.
exmaple:
"qwerty" => key to search
"qasazqertyqwerty"
the program return 1 because qwerty found in the string.

my code function is:

    int normal(char *str, char *str2)
    {
    	int temp=0;
    	while(*str)
    	{
    		while(*str2)
    		{
    			if(*str == *str2)
    			{
    				temp+=1;
    			}
    			else if(temp == strlen(str2))
    			{
    				printf("%d", temp/strlen(str2));
    			}
    			str2++;
    			str++;
    		}
    	}
    return 0;
    }

What the hell the problem in the program(logically)?