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
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.
How can we read/write Structures from/to data files?
What is the full form of stl in c++?
What is meant by entry controlled loop?
Define private, protected and public access control.
Why is main function important?
Do you know what are static and dynamic type checking?
In a function declaration what does extern means?
Is string an object in c++?
What are the 2 main types of data structures?
What are punctuators in c++?
Why are pointers used?
What are static and dynamic type checking?
What is pointer to array in c++?
Do you need a main function in c++?