Warning: Undefined variable $jcyhX in /home/supremepapers/public_html/qualityassignments.net/wp-includes/block-template-utils.php on line 1

Warning: Undefined variable $ettTubkWQB in /home/supremepapers/public_html/qualityassignments.net/wp-includes/nav-menu.php on line 1

Warning: Undefined variable $UUWaafE in /home/supremepapers/public_html/qualityassignments.net/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php on line 1

Deprecated: Implicit conversion from float 1.7333333333333334 to int loses precision in /home/supremepapers/public_html/qualityassignments.net/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/css.php on line 52

Deprecated: Implicit conversion from float 1.7333333333333334 to int loses precision in /home/supremepapers/public_html/qualityassignments.net/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/css.php on line 52

Deprecated: Implicit conversion from float 2.5 to int loses precision in /home/supremepapers/public_html/qualityassignments.net/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/css.php on line 52

Warning: Cannot modify header information - headers already sent by (output started at /home/supremepapers/public_html/qualityassignments.net/wp-includes/block-template-utils.php:1) in /home/supremepapers/public_html/qualityassignments.net/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/supremepapers/public_html/qualityassignments.net/wp-includes/block-template-utils.php:1) in /home/supremepapers/public_html/qualityassignments.net/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/supremepapers/public_html/qualityassignments.net/wp-includes/block-template-utils.php:1) in /home/supremepapers/public_html/qualityassignments.net/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/supremepapers/public_html/qualityassignments.net/wp-includes/block-template-utils.php:1) in /home/supremepapers/public_html/qualityassignments.net/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/supremepapers/public_html/qualityassignments.net/wp-includes/block-template-utils.php:1) in /home/supremepapers/public_html/qualityassignments.net/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/supremepapers/public_html/qualityassignments.net/wp-includes/block-template-utils.php:1) in /home/supremepapers/public_html/qualityassignments.net/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/supremepapers/public_html/qualityassignments.net/wp-includes/block-template-utils.php:1) in /home/supremepapers/public_html/qualityassignments.net/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/supremepapers/public_html/qualityassignments.net/wp-includes/block-template-utils.php:1) in /home/supremepapers/public_html/qualityassignments.net/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":149652,"date":"2022-04-06T00:20:41","date_gmt":"2022-04-06T00:20:41","guid":{"rendered":"https:\/\/qualityassignments.net\/?p=149652"},"modified":"2022-04-06T00:20:41","modified_gmt":"2022-04-06T00:20:41","slug":"modifying-the-code-c-1","status":"publish","type":"post","link":"https:\/\/qualityassignments.net\/2022\/04\/06\/modifying-the-code-c-1\/","title":{"rendered":"modifying the code c 1"},"content":{"rendered":"<\/p>\n

I just want to modify this code in a simple way so it does not look very different that how it is now.<\/p>\n

<\/p>\n

#include <iostream><\/p>\n

#include <string><\/p>\n

bool sentencePalindrome(char *str);<\/p>\n

#define MAX_SIZE 100<\/p>\n

using namespace std;<\/p>\n

int main()<\/p>\n

{<\/p>\n

char *c = new char[MAX_SIZE];<\/p>\n

cout << “Enter a string: “;<\/p>\n

cin.getline(c, MAX_SIZE);<\/p>\n

cout << c << endl;<\/p>\n

if (sentencePalindrome(c)) {<\/p>\n

cout << “The entered string is palindrome” << endl;<\/p>\n

}<\/p>\n

else {<\/p>\n

cout << “The entered string is not palindrome” << endl;<\/p>\n

}<\/p>\n

return 0;<\/p>\n

}<\/p>\n

bool sentencePalindrome(char *str)<\/p>\n

{<\/p>\n

int l = 0, h = strlen(str);<\/p>\n

\/\/ converting the characters to lower case<\/p>\n

for (int i = 0; i < h; i++)<\/p>\n

*(str + i) = tolower(str[i]);<\/p>\n

\/\/ compare the character<\/p>\n

while (l <= h) {<\/p>\n

if (!(*(str + l) >= ‘a’ && *(str + l) <= ‘z’))<\/p>\n

l++;<\/p>\n

else if (!(*(str + h) >= ‘a’ && *(str + h) <= ‘z’))<\/p>\n

h–;<\/p>\n

else if (*(str + l) == *(str + h))<\/p>\n

l++, h–;<\/p>\n

else<\/p>\n

return false;<\/p>\n

}<\/p>\n

\/\/ Returns true if sentence is palindrome<\/p>\n

return true;<\/p>\n

}<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"

I just want to modify this code in a simple way so it does not look very different that how it is now. #include <iostream> #include <string> bool sentencePalindrome(char *str); #define MAX_SIZE 100 using namespace std; int main() { char *c = new char[MAX_SIZE]; cout << “Enter a string: “; cin.getline(c, MAX_SIZE); cout << c […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_joinchat":[]},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/qualityassignments.net\/wp-json\/wp\/v2\/posts\/149652"}],"collection":[{"href":"https:\/\/qualityassignments.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qualityassignments.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qualityassignments.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/qualityassignments.net\/wp-json\/wp\/v2\/comments?post=149652"}],"version-history":[{"count":0,"href":"https:\/\/qualityassignments.net\/wp-json\/wp\/v2\/posts\/149652\/revisions"}],"wp:attachment":[{"href":"https:\/\/qualityassignments.net\/wp-json\/wp\/v2\/media?parent=149652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qualityassignments.net\/wp-json\/wp\/v2\/categories?post=149652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qualityassignments.net\/wp-json\/wp\/v2\/tags?post=149652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}