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...

palindrome for strings and numbers----Can anybody do the
prog?

Answer Posted / sree

#include<stdio.h>
void main
{
int n,t,d,r;
printf("Enter the number:");
scanf("%d",&n);
t=n;
while(n>=1)
{
d=n%10;
r=(r*10)+d;
n=n/10;
}
if(t==r)
printf("Palindrome");
else
printf("Not a palindrome");
}

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1080


What is New modifiers?

1138


Differentiate call by value and call by reference?

983


What does #pragma once mean?

1179


What functions are used in dynamic memory allocation in c?

1097


Can a pointer be volatile in c?

1002


When should the const modifier be used?

1124


What is difference between structure and union in c?

1002


Explain what is the difference between text files and binary files?

1173


What is sizeof c?

1086


How can a program be made to print the line number where an error occurs?

1090


Explain how do you print only part of a string?

1228


Why c is called a mid level programming language?

1084


Is it acceptable to declare/define a variable in a c header?

1134


What are near, far and huge pointers?

1068