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;
}

Remember James Van Der...

Remembering James Van Der Beek: A Legacy of Talent...

vibefoundry 0.1.90

Vibefoundry 0.1.90: Revolutionizing Local Data Science Workflows The data science...

TRENDS Unifies 50+ Systems...

TRENDS Collaborates with Boomi to Revolutionize Manufacturing with AI...

Does eating sugar make...

The Sweet Myth: Does Sugar Consumption Attract Mosquitoes? As the...

Do cockroaches nest in...

The Truth About Cockroaches Nesting in Your Bed It’s one...

Hollywood’s AI Bet Isn’t...

Why Hollywood's Big Bet on AI Is Turning into...

Remember James Van Der Beek by Streaming Dawson’s Creek and His Other Roles

Remembering James Van Der Beek: A Legacy of Talent and Heart The entertainment world is currently in mourning following the heartbreaking news that James Van...

vibefoundry 0.1.90

Vibefoundry 0.1.90: Revolutionizing Local Data Science Workflows The data science landscape is constantly evolving, requiring tools that can keep pace with increasingly complex workflows. The...

TRENDS Unifies 50+ Systems to Build AI-Ready Manufacturing Backbone

TRENDS Collaborates with Boomi to Revolutionize Manufacturing with AI Integration In a significant move toward digital modernization, TRENDS Promotional Products has successfully leveraged the Boomi...

Does eating sugar make mosquitoes worse?

The Sweet Myth: Does Sugar Consumption Attract Mosquitoes? As the summer heat rolls in, so do the mosquitoes. For years, a popular piece of folklore...

Do cockroaches nest in beds?

The Truth About Cockroaches Nesting in Your Bed It’s one of the most unsettling thoughts imaginable: finding pests in the place you seek rest and...

Hollywood’s AI Bet Isn’t Paying Off

Why Hollywood's Big Bet on AI Is Turning into a Box Office Flop The convergence of Artificial Intelligence and cinema was once touted as the...

How far can a buck smell?

The Scent-Sational Truth: How Far Can a Buck Smell? For wildlife enthusiasts and dedicated hunters, understanding the sensory world of the whitetail deer is crucial....

Google’s Gemini 3 Release Won Over More Than 100 Million New Active Users

Google Gemini 3 Racks Up 100 Million New Active Users, Challenging ChatGPT's Dominance The artificial intelligence landscape is witnessing a seismic shift, confirmed by new...

Nvidia nears deal to invest $25.4 billion in OpenAI funding round

Nvidia Nears Historic $25.4 Billion Investment in OpenAI Funding Round The landscape of artificial intelligence is poised for another seismic shift as reports indicate that...