Can someone please tell me what is wrong with this code
int main()
{
char str[10],str2[10];
int k,i=0,j;
printf("enter de string\n");
scanf("%s",str);
k=strlen(str);
printf("length of de string %d\n",k);
for(j=k-1;j=0;j--)
{
str2[i++]=str[j];
}
printf("%s",str2);
for(i=0;i<k;i++)
{
if(strcmp(str,str2)==0)
{
printf("palindrome");
}
}
return 0;
}
this is my output
enter de string
jamiaj
length of de string 6
Why is the code after printing the length not working.