Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can somebody help wtih C please, and the user needs to input the words!! Thanks Write a program to reverse the words of a string.

Can somebody help wtih C please, and the user needs to input the words!!

Thanks

image text in transcribed

Write a program to reverse the words of a string. Implement a function reverse() that reverses the string between indexes i and j inclusively. Prototype of the function is given below. void reverse(char * str, int i, int j) An example is given in figure 1. If we have reverse(str, 0, 4) it reverses the string between indexes of 0 and 4 from apple to elppa. You can reverse all the words of a string by finding start and end positions of each word and reversing the word. Assume that you have only uppercase and lowercase letters in the word. Sample execution is given below fox01> recitation7 Enter a string: apple orange banana Reversed string: ananab egnaro elppa

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions