Question: 9 . 5 LAB: Working with c - strings Write a C + + program that reads a sentence into a c - string of

9.5 LAB: Working with c-strings
Write a C++ program that reads a sentence into a c-string of maximum 80 characters, a character into a variable called c , and an integer into n , and then passes all three of these variables to a function that searches for the character c and prints the character and the next n characters of the string, if the character is found. If it doesn't find the character in the string it must print "The character was not found. 'For example, if the user enters "Superbowl tickets are too expensive." and then enters \( t \) and 7, the function must print tickets.
LAB
\#include
using namespace std;
//function definition here
int main()\{
//your program here
return 0;
}}
Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box.
Predefine program input (optional)
9 . 5 LAB: Working with c - strings Write a C + +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!