Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write program for palindrome

Answers were Sorted based on User's Feedback



write program for palindrome..

Answer / apoorv

#include<stdio.h>
#include<conio.h>
int main()

{
long int n,s=0,m,r;
printf("enter any no");
scanf("%ld",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(m==s)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    0 Yes 1 No

write program for palindrome..

Answer / jamai partha

#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==n)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    0 Yes 1 No

write program for palindrome..

Answer / ashok

#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 ?    0 Yes 1 No

write program for palindrome..

Answer / bhavesh vala

#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(m==n)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    1 Yes 2 No

write program for palindrome..

Answer / m.sathish krishna

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

Is This Answer Correct ?    0 Yes 1 No

write program for palindrome..

Answer / bala murali

#include<stdio.h>
#include<conio.h>
main()
{
char s1,s2;
printf("enter a string:");
gets(s1);
strcpy(s2,s1);
strrev(s2);
if(strcmp(s1,s2))
printf("palindrome:");
else
printf("not a palindrome:");
getch();
}

Is This Answer Correct ?    0 Yes 1 No

write program for palindrome..

Answer / prakash

#include<stdio.h>
#include<conio.h>

main()
{

char s1[10],s2[10];
int m,i,j;
scanf("%s",s1);
strcpy(s2,s1);
m=strlen(s1);
for(i=0,j=m-1;i<=m-1,j<=0;i++,j--)
{
if(s1[i]!=s2[j])
printf("STRING IS NOT PALINDROME ");
}
printf("STRING IS a PALINDROME ");
getch();
}

Is This Answer Correct ?    0 Yes 2 No

write program for palindrome..

Answer / krishna reddy

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

Is This Answer Correct ?    0 Yes 2 No

write program for palindrome..

Answer / gunajit bhuyan (ulubar, guwaha

void main()
{
int n,num,digit,sum,rev;
printf("input a number to check for palindrom\n");
scanf("%d",&n);
n=num;
do
{
digit=num%10;
sum+=digit;
rev=rev*10+digit;
num/=10;
while (num!=0);
printf("sum of the digits of the number is =%d",sum);
printf("Reverse of the number is =%d",rev);
if(n==rev)
printf("this number is palindrom");
else
printf("this number is not palindrome");
getch();
}

Is This Answer Correct ?    0 Yes 2 No

write program for palindrome..

Answer / md. irshad alam

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
void main()
{
clrscr();
int palind(char []);
int r;
char name[5];
cout<<"Enter a String...";
gets(name);
r=pal(name);
if(r==0)
{
cout<<"\n"<<"PALINDROME...";
}
else
{
cout<<"\n"<<"NOT A PALINDROME...";
}
getch();
}
int palind(char name[])
{
char *p,*t;
p=name;
t=name+strlen(name)-1;
while(*p)
{
if(*p != *t)
{
return(1);
}
p++;
t--;
}
return(0);
}

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C++ General Interview Questions

What are the popular tools used to detect memory leaks in c++

4 Answers   TATA,


What are templates? where we should use it?

2 Answers   Alcatel,


whats the size of class EXP on 32 bit processor? class EXP { char c1; char c2; int i1; int i2; char *ptr; static int mem; };

5 Answers   Huawei,


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

0 Answers  


Where must the declaration of a friend function appear?

0 Answers  


What is istream and ostream in c++?

0 Answers  


What is input operator in c++?

0 Answers  


How many pointers are required to reverse a link list?

5 Answers   CTS,


How can you quickly find the number of elements stored in a static array?

0 Answers  


How to demonstrate the use of a variable?

0 Answers  


Distinguish between new and malloc and delete and free().

0 Answers  


How do you print a string on the printer?

0 Answers  


Categories