Back

please check my program for palindrome...

Created 1 year ago
55 Views
1 Comments
SRINIDHIvmacL0
@SRINIDHIvmacL0
SRINIDHIvmacL0
@SRINIDHIvmacL0Profile is locked. Login

#include<string.h>

#include<stdio.h>

void main()

{

int l=0,h;

char str[100];

printf("");

scanf("%s",str);

h=strlen(str)-1;

while(h>1)

{

if((l++)!=(h--))

printf("0");

return 0;

}

printf("1");

return 0;

}

it works for even no.of strings but doesnt work for odd no.of strings....should i add an if construct so that it works for odd strings also???

Comments
Please login to comment.