Write a program that reads a list of integers from input and determines if the list is a palindrome (values are identical from first to last and last to first). The input begins with an integer indicating the length of the list that follows. Assume that the list will always contain fewer than 20 integers. Output "yes" if the list is a palindrome and 'no' otherwise. The output ends with a newline. Ex: If the input is: 6 15995 1 the output is: yes Ex: If the input is: 5 1 2 3 4 5 the output is: no

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question
Please write in c++
Write a program that reads a list of integers from input and determines if the list is a palindrome (values are identical from first to last and
last to first). The input begins with an integer indicating the length of the list that follows. Assume that the list will always contain fewer than
20 integers. Output "yes" if the list is a palindrome and 'no' otherwise. The output ends with a newline.
Ex: If the input is:
6
15995 1
the output is:
yes
Ex: If the input is:
5
1 2 3 4 5
the output is:
no
464730 3214874qx3zqy7
LAB
ACTIVITY
5.28.1: LAB: Vector palindrome
main.cpp
1 #include <iostream>
2 #include <vector>
CS Scanned with CamScanner
/ Type your code here. /
0/10
Load default template...
Transcribed Image Text:Write a program that reads a list of integers from input and determines if the list is a palindrome (values are identical from first to last and last to first). The input begins with an integer indicating the length of the list that follows. Assume that the list will always contain fewer than 20 integers. Output "yes" if the list is a palindrome and 'no' otherwise. The output ends with a newline. Ex: If the input is: 6 15995 1 the output is: yes Ex: If the input is: 5 1 2 3 4 5 the output is: no 464730 3214874qx3zqy7 LAB ACTIVITY 5.28.1: LAB: Vector palindrome main.cpp 1 #include <iostream> 2 #include <vector> CS Scanned with CamScanner / Type your code here. / 0/10 Load default template...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT