Question: Write a program that Has three character strings of 80 characters char inputString[80]; char reverseString[80] = char wordReverseString[80] = 1. Prompts and Reads
Write a program that Has three character strings of 80 characters char inputString[80]; char reverseString[80] = "" char wordReverseString[80] = ""
1. Prompts and Reads a sentence from the user (max 80 characters)
printf("%s ","Enter a sentence that is less that 80 characters");
scanf("%s",inputString);
2. Calls a function that receives the address of inputString and reverseString. That function copies the inputString into reverseString in the opposite order. It returns a pointer to reverseString. 3. Calls a function that receives the address of inputString and wordReverseString. That function creates a copy of inputString into wordReverseString with the words in the opposite order. It returns a pointer to wordReverseString. 4. Finally, it prints all three strings to the console.
Example:
If the user enters "This is fun"
reverseString would hold "nuf si sihT"
and wordReverseString would hold "fun is This"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
