Find string palindrome 10marks
Answer Posted / coolcom(chandan)
void main()
{
int a,len,palin;
char s[20];
scanf("%s",s);
len=strlen(s);
printf("%d \n",len);
for(a=0,len=len-1;a<len;a++,len--)
{
palin=0;
if(s[a]==s[len])
palin=1;
else
{
printf("string %s is not palindrome",s);
getch();
exit();
}
}
printf("string %s is palindrome",s);
getch();
}
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
What are register variables? What are the advantage of using register variables?
What is the difference between scanf and fscanf?
can we have joblib in a proc ?
What is the scope of global variable in c?
Explain what is the benefit of using #define to declare a constant?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
Write a code to remove duplicates in a string.
if p is a string contained in a string?
What is the difference between the local variable and global variable in c?
Is return a keyword in c?
Do you know the purpose of 'register' keyword?
What are structure types in C?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
What are the different types of control structures?
Lists the benefits of c programming language?