programming in c code

User Generated

abbe96

Programming

Description

we have only taken loops, if statements, strings, arrays, pointers. make sure to only use these. simple coding for beginners nothing too complex with comments. for this code you need to use string (array of char) and string manipulation functions.

question:

Write a function: void reverse(char * line, char * reversed) that takes data a line at a time and reverse the words of the line. For example, Using the reverse function, write a program which, in a loop:
1. Prompts user to enter a line and reads it from input
2. Passes the string to function reverse
3. Prints out the reversed line
4. Prompts the user to ”do another” by typing ”y”, or to quit the program by typing anything else.
Sample Output: Enter a line: birds and bees The reverse is: bees and birds Do Another (y/n)?y Enter a line: Hello World The reverse is: World Hello Do Another (y/n)?n Press any key to continue

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello, I will start working on it shortly and submit a complete answer as soon as am done.
Attached.

#include
void ReverseString(char *s, char *reversed);
void ReverseWords(char *begin, char *end);
char reversed[50];
int length;
int main()
{
// Prompt user for a sentence
char doanother='Y';
// Wrap with a ...


Anonymous
Goes above and beyond expectations!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags