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
How do I start a c++ project?
What are the two main components of c++?
What is c++ used for in games?
What is the use of setfill in c++?
Explain Text Manipulation Routines?
When can I use a forward declaration?
What are friend classes? What are advantages of using friend classes?
What do you mean by “this” pointer?
Mention the ways in which parameterized can be invoked.
Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.
What are shallow and deep copy?
Can member data be public?
What is the difference between while and do while loop? Explain with examples.
Why do we use double in c++?
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c