write program for palindrome
Answer Posted / mojib khan
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char str1[30],str2[30];
int l;
clrscr();
printf("Enter the string \t");
gets(str1);
strrev(str1);//for reverse string
strcpy(str1,str2);//copy str1 to str2
l=strcmp(str2,str1); //comparing strings it will return 0/1
if(l==0)
{
printf("\nString is Palindrom");
}
else
printf("String is not palindrom");
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is null c++?
Is c++ a programming language?
Explain about Garbage Collector?
What is the difference between *p++ and (*p)++ ?
Define a nested class. Explain how it can be useful.
What are the five basic elements of a c++ program?
Is there any difference between int [] a and int a [] in c++?
What is the difference between prefix and postfix versions of operator++()?
How can I learn dev c++ programming?
Explain the difference between abstract class and interface in c++?
What is isdigit c++?
What is the use of endl in c++ give an example?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
Does c++ support exception handling?
What is the difference between object-oriented programming and procedural programming?