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
Naddik [55]
3 years ago
8

C++

Computers and Technology
1 answer:
kotegsom [21]3 years ago
8 0

Answer:

a) # include <iostream>

# include <conio.h>

# include <stdio.h>

# include <string.h>

using namespace::std;

bool IsPalindrome(const string& str)

{

   if (str.empty())

       return false;

   int i = 0;                // first characters

   int j = str.length() - 1; // last character

   while (i < j)

   {

     

       if (str[i] != str[j])

       {

           return false;

       }

       i++;

       j--;

   }

   return true;

}

int main()

{      

      string str;

      cout<<"Enter the string";

      getline(cin, str);

      bool a= IsPalindrome(str);

      if(a)

      {

          cout<<"Is in palindrome";

      }

      else

      {

          cout<<"Is not in palindrome";

      }

}

b) Modified version of function with full program to discard uppercase or lowercase is as below:

# include <iostream>

# include <conio.h>

# include <stdio.h>

# include <string.h>

using namespace::std;

bool IsPalindrome(const string& str)

{

   if (str.empty())

       return false;

   int i = 0;                // first characters

   int j = str.length() - 1; // last character

   while (i < j)

   {

       char a= tolower(str[i]);

       char b= tolower(str[j]);

       if (a != b)

       {

           return false;

       }

       i++;

       j--;

   }

   return true;

}

int main()

{      

      string str;

      cout<<"Enter the string";

      getline(cin, str);

      bool a= IsPalindrome(str);

      if(a)

      {

          cout<<"Is in palindrome";

      }

      else

      {

          cout<<"Is not in palindrome";

      }

}

Explanation:

Please check the answer section.

You might be interested in
You can use the ____ command to delete an entire table and its data.?
jek_recluse [69]
You can press control and x at the same time, the delete button, or backspace
6 0
4 years ago
Consider the following code:
weqwewe [10]

Answer:

252

Explanation:

I tested the code and it outputted 252

hope i helped :D

4 0
3 years ago
The ________ of the operating system enables users to communicate with the computer system. Select one: A. user interface B. mod
Mumz [18]
The user interface of the operating system
8 0
3 years ago
With the help of ________, the digital version of a document is displayed on the screen for a human viewer to verify letters the
Nostrana [21]

With the help of Intelligent Character Recognition, the digital version of a document is displayed on the screen for a human viewer to verify letters the software cannot read.

6 0
3 years ago
Read 2 more answers
In Marvel Comics, what imaginary rare metal is an important natural resource of Wakanda, the home country of Black Panther?
DerKrebs [107]

Answer:

vinranium

Explanation:

i watched the movie

IM SO SMART!!!!!!!!!!!!! UWU

3 0
3 years ago
Other questions:
  • video-sharing sotes such as youtube and vimeo provide a place to post short videos called clips true or false?
    5·1 answer
  • The process of executing a program is also called ________.
    8·1 answer
  • Henry must choose which type of smart speaker to use in his home. He asked you to help him decide which one will best suit his n
    11·1 answer
  • What is the disadvantage of a mesh topology?
    12·2 answers
  • What happens when two computers use the same IP address?
    15·1 answer
  • Look at the following program and answer the question that follows it. 1 // This program displays my gross wages. 2 // I worked
    8·1 answer
  • 6
    9·1 answer
  • Help please match them if you just put a link or say “I don’t know but thanks for the points” I’ll report your answer and you wo
    10·1 answer
  • What is destination email address​
    8·1 answer
  • Top/Bottom Rules allow a user to apply conditional formatting to cells that fall within the top or bottom numbers or percentile.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!