write program for palindrome
Answer Posted / mojib khan
#include<stdio.h>
void main()
{
int i=0,l,flag=0;
char str[30];
clrscr();
printf("Enter the string\n");
gets(str);
l=strlen(str)-1;
while(i<=l)
{
if(str[i]==str[l])
flag=1;
else
{
flag=0;
break;
}
i++;
l--;
}
if(flag==1)
printf("String is palindrom");
else
printf("\n String is not palindrom");
getch();
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Difference between overloading vs. Overriding
What is the history of c++?
Does there exist any other function which can be used to convert an integer or a float to a string?
What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.
Differentiate between a pointer and a reference with respect to c++.
Why do we learn c++?
What do the header files usually contains?
What is ios flag in c++?
What is an undefined reference/unresolved external symbol error and how do I fix it?
What is polymorphism and its type in c++?
How does a copy constructor differs from an overloaded assignment operator?
what Is DCS ? what i will get benefit when i did?
In the derived class, which data member of the base class are visible?
How many different levels of pointers are there?
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.