Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,102 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,674 people online right now. Registration is fast and FREE... Join Now!




Having trouble with doin palindrome program by simble way

 
Reply to this topicStart new topic

Having trouble with doin palindrome program by simble way

saihat
2 Oct, 2007 - 09:55 PM
Post #1

New D.I.C Head
*

Joined: 2 Oct, 2007
Posts: 1



Thanked: 1 times
My Contributions
A palindrome is a number or a text phrase that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a program that reads in a five-digit integer and determines whether it is a palindrome or not
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Having Trouble With Doin Palindrome Program By Simble Way
2 Oct, 2007 - 10:13 PM
Post #2

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,906



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Read the Forum Rules
You need to take efforts to solve the problem.
Attempt it yourself. If the code doesn't work, post your code here and we'll tell you where you went wrong.
User is offlineProfile CardPM
+Quote Post

eastgod
RE: Having Trouble With Doin Palindrome Program By Simble Way
3 Oct, 2007 - 03:05 AM
Post #3

New D.I.C Head
*

Joined: 3 Oct, 2007
Posts: 2


My Contributions
QUOTE(saihat @ 2 Oct, 2007 - 10:55 PM) *

A palindrome is a number or a text phrase that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a program that reads in a five-digit integer and determines whether it is a palindrome or not

HELLO....! I DON'T THINK YOU HAVE READ DA RULES NO DOIN HOMEWORK...JUST HELP....!
IF YOU STILL NEED HELP THEN MAIL MEEEE...FEEL FREE TO DO SO..!
User is offlineProfile CardPM
+Quote Post

Smarf
RE: Having Trouble With Doin Palindrome Program By Simble Way
3 Oct, 2007 - 07:53 AM
Post #4

D.I.C Head
**

Joined: 21 Sep, 2007
Posts: 80



Thanked: 2 times
My Contributions
A few hints:

- You can use the modulus (%) operator to pick off each digit. Think in terms of single's place, ten's place, hundred's place, thousand's place, and ten thousands place.

- The middle digit doesn't matter, it can be anything.

- Compare the first digit to last digit and if they're the same compare the second digit to fourth digit. If those are the same it's a palindrome, otherwise it's not.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 09:01PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month