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

  Describe the probability of the moves

Write a program in C++ to describe the Probability of the moves

  Loops and if conditions

Write a program that requests a password

  Create the appropriate constructor, getters and setters

Create the appropriate constructor, getters and setters for the class. Create an instance of Student for each of the students listed above from array. Construct the instance with lastname, firstname, and job.

  Three or more dimensions

What kind of program, or problem, might necessitate arrays of three or more dimensions?

  Public transport fare ticketing system

Implement and test a public transport fare ticketing system.

  Implementation of classes

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

  Write program to count occurrences of each word in text

Write down C++ program to read following text. Count occurrences of each word in text and keep this count in list of elements containing (word, occurrence count) pairs.

  Write recursive boolean method to accept array and value

Write down the recursive boolean method named isMember. The method must accept two arguments: an array and a value. Method must return true if value is found in array.

  Prepare a businesspartner

Prepare a BusinessPartner class that contains a company name, first name and a telephone number.

  Write a program that computes the cost of long distance call

Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules.

  A c++ program using the concept of function overloading

write a c++ program using the concept of function overloading for the following options : select the options from [1-3], 1- Area of rectangle 2- Area of square 3- Exit ,

  A series of one-digit non-negative numbers

Write a program that asks the user to enter a series of one-digit non-negative numbers

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