write program for palindrome

Answers were Sorted based on User's Feedback



write program for palindrome..

Answer / viggi

here, don't use long int

Is This Answer Correct ?    0 Yes 0 No

write program for palindrome..

Answer / baskaran

#include<stdio.h>
#include<string.h>
#define size 26
void main()
{
char strsrc[size];
char strtmp[size];

printf("\n Enter String:= ");
gets(strsrc);
strcpy(strtmp,strsrc);
strrev(strtmp);
if(strcmp(strsrc,strtmp)==0)
printf("\n Entered string \"%s\" is palindrome\n",strsrc);
else
printf("\n Entered string \"%s\" is not
Palindrome\n",strsrc);
}

Is This Answer Correct ?    1 Yes 1 No

write program for palindrome..

Answer / saisuresh

yes correct

Is This Answer Correct ?    0 Yes 0 No

write program for palindrome..

Answer / vijay kumar

#include<stdio.h>
#include<conio.h>
void main()
{
int n,rev=0,m,r;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
rev=rev*10+r;
n=n/10;
}
if(rev == m) // This is important step
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    0 Yes 0 No

write program for palindrome..

Answer / uday

#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(s == m) // This is important step
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    0 Yes 0 No

write program for palindrome..

Answer / saurav sadangi

#include<stdio.h>

int main(){
int m,n,sum=0,r;
printf("Enter n: ");
scanf("%d",&n);
m=n;
while(n>0){
r=n%10;
sum=sum*10+r;
n=n/10;
}
if(sum==m){
printf("The no %d is pallendrom\n",m);
}
else{
printf("The no %d is not pallendrom\n",m);
}
system("PAUSE");
return 0;
}

Is This Answer Correct ?    0 Yes 0 No

write program for palindrome..

Answer / tarun soni

#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(s==m)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    0 Yes 0 No

write program for palindrome..

Answer / katta shravan kumar

#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
n=n/10;
s=n*10+r;
}
if(m==n)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    0 Yes 0 No

write program for palindrome..

Answer / mohammed arif khan

//MOHAMMED ARIF KHAN
// PROGRAM OF PALIDROM

#include<stdio.h>
#include<conio.h>
void main()
{
char str[20],*ptr,*ptr1;
int c=0;
clrscr();
printf("Enter the string:");
scanf("%s",&str);
for(ptr1=str;*ptr1!='\0';ptr1++);

ptr1--;
for(ptr=str;*ptr!='\0';ptr++,ptr1--)
{
if(*ptr!=*ptr1)
{
c=1;
break;
}
}
if(c==0)
{
printf("\n palindrome");
}
else
{
printf("\n not palindrome");
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No

write program for palindrome..

Answer / jeet here

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
string s,s1;



SORRY I HAVE FORGOTTEN RIGHT NOW .PLZ SEND ME THIS
ANSWER TO MY Email.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

If there are two catch statements, one for base and one for derived, which should come first?

0 Answers  


What is an operator function? Describe the function of an operator function?

0 Answers   Fidelity,


Difference between a copy constructor and an assignment operator.

0 Answers  


Write a c program for binary addition of two 8 bit numbers.

0 Answers   TCS,


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

0 Answers  


what is data encapsulation in C++?

0 Answers  


What is c++ map?

0 Answers  


what is importance of data sturture in a programming language?

22 Answers   L&T, TCS, Wipro,


What do you mean by Stack unwinding?

1 Answers  


Is std :: string immutable?

0 Answers  


iam a fresher to Qt(GUI a c++ based framework software). i need to develop the basic applications on designer by drag and dropping mechanism...so pls send me the procedure to design applications?

1 Answers  


Which is the best c++ software?

0 Answers  


Categories