A palindrome is a number

Assignment Help C/C++ Programming
Reference no: EM13161325

 

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

Solving Steps:

Use integer division method (similar to the Excel Assignment Question 4) to solve the problem.

Part 2:

Write a program that checks whether the string given by the user is Palindrome or not.

A string can be said as a Palindrome in the case when you reverse the string and gives the same original string. For example think of a word like ABCCBA:

Original String: ABCCBA

Reverse String: ABCCBA

So both the original and the reverse match each other, so the string is a Palindrome.

In this problem only one word will be used and you need to check whether the word is a palindrome or not. Do not use any built-in functions; use the technique defined below.

How to check whether the string is palindrome or not:

str[0]    str1 [1]        str1 [2]          str1 [3]     str1 [4]      str1 [5]

A               B               C                  C                B            A

i=0                                                                                  j=5

Solving Steps:

Compare the character of str[i] and str[j]

Increment i++ (by 1) and Decrement j-- (by1)

Stops when i and j are equal or j<i

 

 

Reference no: EM13161325

Questions Cloud

What is the ph of the buffer after the addition of hi : What is the pH of the buffer after the addition of 0.02 mol of NaOH? C)What is the pH of the buffer after the addition of 0.02 mol of HI? Express Numerically
What is the structure of the eukaryote : Give examples of medications that malaria is resistant to and the medications it is susceptible to.
Explain the initial temperature of the calorimeter : The initial temperature of the calorimeter is 23.0. If 6.30 of is added to the calorimeter, what will be the final temperature of the solution in the calorimeter?
What are the causes and effect of the disease malaria : What are the causes and effect of the disease malaria?
A palindrome is a number : A palindrome is a number or text phrase that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 34543 and 11611. Write a program that reads in a five-digit integer and determines ..
In which phase can cryptic growth sometimes occur : In which phase can "cryptic growth" sometimes occur?
State component in the original mixture : How do I find the weight percent of each component in the original mixture and would this affect the outcome if Methanol had been used in place of the dichloromethane? Product weight of Oil: 0.11g & Product weight of Polypropylene Glycol : 0.19g.
Define a function to calculate the values : Be sure to define a function to calculate the values and print the table displaying the interest rate in the first column, the monthly payment in the second column, and the total payment in the third column. Your program should not allow the user to ..
Colonial violence in the last quarter of the 17th century : Colonial violence in the last quarter of the 17th century most clearly led to:  the Glorious Revolution.  tighter control over the colonies by the mother country.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd