write program for palindrome

Answer Posted / faiz misbah

#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i,j,f=0;
char a[10];
clrscr (); // only works on windows
gets(a);
for (i=0;a[i]!='\0';i++)
{
}
i--;
for (j=0;a[j]!='\0';j++,i--)
{
if (a[i]!=a[j])
{
printf("string is not palindrome");
return(0);
}
}

printf("string is palindrome");
return(0);
}

Is This Answer Correct ?    91 Yes 84 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.

2512


How can we read/write Structures from/to data files?

599


What is the full form of stl in c++?

642


What is meant by entry controlled loop?

630


Define private, protected and public access control.

586






Why is main function important?

561


Do you know what are static and dynamic type checking?

589


In a function declaration what does extern means?

568


Is string an object in c++?

640


What are the 2 main types of data structures?

567


What are punctuators in c++?

626


Why are pointers used?

551


What are static and dynamic type checking?

587


What is pointer to array in c++?

587


Do you need a main function in c++?

536