Sponsors

How To Reverse A String Without Reversing The Punctuation On That Line – The Shining Part 3 Problem Solution In C

The Shining-Part3
Assume, in \The Shining-Part3″, the son makes it even worse by reversing the words in a sentence in place
but leaving the punctuations as they are. For example, the son writes \NUR, REHTOM! REDRUM!!” to
mean \RUN, MOTHER! MURDER!!”. Now the mother needs to understand the full sentence as it is but
she cannot get it through a mirror.
This time for the Part-3 of the lm, alert the mother by writing another code.

#include

int check(char c);
void print(char s[], int length);
int strlength(char s[]);
int main()
{
int i, j, length;
char s[5000], s1[5000];
printf(“Enter the string\n”);
gets(s);
///printf(“%d\n”,strlen(s));
///puts(s);
length=strlength(s); /// a function to determine the lenght of the string
///printf(“%d %d %d %d”,’A’,’a’,’Z’,’z’);
printf(“corrected string: “);
for(i=0,j=0;i<length;i++) { if(check(s[i])==1) /// a function to check s[i] { s1[j]=s[i]; j++; } else { print(s1,j); /// a function to reverse the word and print j=0; printf(“%c”,s[i]); } } print(s1,j); printf(“\n”); return 0; } int check(char c) { if(c>=’A’ && c<=’Z’) return 1; if(c>=’a’ && c<=’z’) return 1; return 0; } void print(char s[], int length) { int i; for(i=length-1;i>=0;i–)
{
printf(“%c”,s[i]);
}
}
int strlength(char s[])
{
int i;
for(i=0;s[i]!=’\0′;i++);
return i;
}

The Road Wraps Up...

"The Road" Hits a Major Milestone: Wrapping Up the...

A Radical New Kind...

The Tabletop Revolution: Compact Particle Accelerators Poised to Transform...

Why Native American Heritage...

The Profound Significance of Native American Heritage Month in...

Driverless rideshare service Waymo...

Waymo’s Driverless Rideshare Service Headed to San Diego Amid...

Ascot Reports Third Quarter...

Ascot Resources Releases Unaudited Third Quarter 2025 Financial Results VANCOUVER,...

First Ikea, now Costco...

Kiwi Property Group Plays Trump Cards with Costco and...

The Road Wraps Up Its Oklahoma Ranch, OKC Run: Our S01E05 Preview

"The Road" Hits a Major Milestone: Wrapping Up the Oklahoma Leg in S01E05 Music competition fans are gearing up for the next stage of the...

A Radical New Kind of Particle Accelerator Could Transform Science

The Tabletop Revolution: Compact Particle Accelerators Poised to Transform Research For decades, the realm of high-energy physics and advanced materials science has been dominated by...

Why Native American Heritage Month matters in San Diego

The Profound Significance of Native American Heritage Month in San Diego November marks Native American Heritage Month (NAHM), a period dedicated to recognizing the rich...

Driverless rideshare service Waymo coming to San Diego gets mixed reactions

Waymo’s Driverless Rideshare Service Headed to San Diego Amid Mixed Community Reactions San Diego is officially slated to become the next major metropolitan area to...

Ascot Reports Third Quarter 2025 Results

Ascot Resources Releases Unaudited Third Quarter 2025 Financial Results VANCOUVER, British Columbia – Ascot Resources Ltd. (TSXV: AOT.H; OTCID: AOTVF) has officially announced its unaudited...

First Ikea, now Costco Wholesale: Kiwi Property Group plays trump cards

Kiwi Property Group Plays Trump Cards with Costco and Ikea Kiwi Property Group (KPG) is strategically reshaping its commercial landscape, making major moves that cement...

NBC’s “Today” Show Runs Credulous Report Claiming “Proof” of Noah’s Ark

NBC's Today Show Under Fire for Credulous "Proof" of Noah’s Ark Report A recent segment on NBC’s venerable Today show has sparked significant criticism within...

Will Emmvee Photovoltaic IPO deliver gains for long-term investors?

Emmvee Photovoltaic IPO: A Bright Outlook for Long-Term Solar Investors? The Indian renewable energy sector continues to shine brightly on the financial markets, and the...

$200 a week and tinned fish: Cost of living hits international students

Australia's Cost of Living Crisis Pushes International Students to the Brink The dream of studying abroad in Australia is quickly turning into a financial nightmare...