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

  Program that will ask for a month

Write a program that will ask for a month (1-12) and a year (yyyy). the program should then produce a calendar showing the month name and year and have all of the days displayed under it.

  Write c program that forks two child processes

Write a C program that forks two child processes. The parent process will print all prime numbers up to 229, the first child process will print the first 50 Fibonacci numbers.

  Method celsius return celsius equivalent of fahrenheit

Method Celsius return the Celsius equivalent of a Fahrenheit temperature,using the calculation Celsius = 5.0/9.0*(Fahrenheit -32); method Fahrenheit returns the Fahrenheit equivalent of a Celsius temperature, using the calculation  Fahrenheit = 9.0/5..

  State private portion of class to model the item

In c++ state the private portion of a class to model the given item: a class Date for dates consisting of a month, day and year. a class PhoneNumber for a telephone numbers consisting of area code, local exchange, and number.

  File system with login authentication

Implement a simple file system with login authentication and access control - Construct a hash/salt/shadow based user/password creation system.

  Write c program to read one ip address

Write a C or C++ program which Read one IP address at a time from Dec_IPAddresses.txt and convert it into Hex. Store converted values stored in another file (e.g. HEX_IPAddresses.txt).

  Design a deck plan space ship in eclipse

Develop a simple interactive two-dimensional spaceship deck plan editor using OpenGL and GLUT. Your program will enable a user to create and save a deck plan of a hypothetical spaceship comprising the hull walls.

  Develop a simple poker game

Develop a simple poker game

  Asks the user for the name of an input file and translates

Write a C++ program that asks the user for the name of an input file and translates the contents of that input file using ROT13. Your  main  function should be responsible for reading the input file and coordinating calls to a value-returning functio..

  C program to calculate power loss in transmission line

Write program in C to calculate the power loss in transmission line with resistance of 0.05 ohms/mile. Calculate power loss if 500 kW of power is transmitted from power generation station

  C programme to find the minimum and maximum value

write a c programme to find the minimum and maximum value each elements in each row ,to create table b,having 5 rows and 2 coloums,the first coloum of table b is the maximumvalue and thye second coloum is the maximum value in each row.

  Design and write a c++11/fltk game program

The project is to design and write a C++11/FLTK game program with a graphical user interface. The game is based on "pancake sorting," which actually has some mathematical significance.

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