1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elden [556K]
4 years ago
7

A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "never

odd or even" (ignoring spaces). Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome.
Computers and Technology
1 answer:
seropon [69]4 years ago
3 0

Answer:

c++ program to check palindrome.

#include <bits/stdc++.h>

using namespace std;

int main() {

   string pal;

   bool b=1;

   getline(cin,pal);//taking input of a word or a line.

   int s=0,e=pal.length()-1;

   while(s<e)//loop to check palindrome.

   {

       if(pal[s]!=pal[e])

       {

           b=0;

           break;

       }

       s++;

       e--;

   }

   if(b)

       {

           cout<<"Text is palindrome"<<endl;//printing the message.

       }

       else

       {

           cout<<"Text is not palindrome"<<endl;//printing the message.

       }

return 0;

}

Output:-

geeks skeeg

Text is palindrome

geeks skeegs

Text is not palindrome

Explanation:

I have taken a string pal for the input of word or a text then I have taken two pointers one for starting and one for the end.In the loop i am keep checking the first and last characters of the string if they are same then continue otherwise break out of the loop and print not palindrome.

You might be interested in
Identifying Characters
alina1380 [7]
The answer is d I just took the test
5 0
3 years ago
Read 2 more answers
Which of the following is the most reliable way to check the accuracy of a website?
ELEN [110]

Answer:

Examine the sources cited by the website

Explanation:

Due to the ability for everyone to create a website, and that there are no governing standards on the quality of information given on websites, it is important when conducting research to ensure that the sources on the web are up to date, accurate, and provide an objective view

Therefore, it is important to go through and examine the website critically using the the following criteria

1) The website coverage

2) The currency of the website's information

3) Weather the website is objective or not

4) The identity of the author of the website and the ability to contact the author

5) The accuracy of the information contained in the website

3 0
3 years ago
Have you been tempted to do something online that you wouldn't do if<br> people knew it was you?
Aleksandr-060686 [28]

Answer

I don't know tbh, Maybe once or twice here or there.

Explanation:

6 0
3 years ago
Pradeep and his cousin went to the corner store to buy candy. His cousin paid and told Pradeep he could pay him back. "You owe m
NeTakaya

Answer:

"It is 80 cents"

Explanation:

In order to calculate how much this actually is, we would need to multiply this fraction by the value of a whole dollar which is 1. We can divide the fraction 4/5 and turn it into the decimal 0.80 which would make this much easier. Now we simply multiply...

0.80 * 1 = $0.80

Finally, we can see that 4/5 of a dollar would be 0.80 or 80 cents. Therefore Pradeep would answer "It is 80 cents"

8 0
3 years ago
Print("Student" == "Teachers" or 99 != 88) will output False<br><br> true or false
ioda

Answer:

it will output True, so the statement is false

Explanation:

6 0
3 years ago
Other questions:
  • A concave lens is also called a diverging lens. please select the best answer from the choices provided t f
    6·1 answer
  • 9) If you are working on the part of 5-15 minutes, time-stamping (every 30 seconds) should start at: a) [00:05:00] b) [00:00:00]
    9·1 answer
  • Which microphones are considered to have the best quality?
    12·2 answers
  • One of the difficult decisions a systems analyst has to make when it comes to software is whether to recommend making, buying, o
    13·1 answer
  • Which of the following does not use a Graphic User Interface?
    14·1 answer
  • Give two reasons you should be aware of your computer's system components and their characteristics.
    10·1 answer
  • To print factorial of any<br>input number <br>QBASIC​
    6·1 answer
  • What is the different between the patch Tool and the Headling Brush tool?​
    5·1 answer
  • Difference between the four generations of computers in a tabular form​
    8·1 answer
  • The person or user associated in computer field is called​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!