Write a c language program that searches a string

Assignment Help Computer Engineering
Reference no: EM132194492

Part 1

Write a C language program that searches a string for the last occurrence of a specified character. When it finds the character, it should print the remainder of the string. Specifically, your program should do the following:

1. Declare a string variable (character array) that can hold up to 60 characters.

2. Initialize the string variable to the following: "Chicago was known for meat packing and gangsters."

3. Prompt the user to enter a character for which to search.

4. Use the standard function to search the string for the last occurrence of this character.

5. If the character is not found, print a message to the console.

6. If the character is found, print the remainder of the string beginning at this character.

Test your program with the character 'g' and submit a printout of your program output along with a program listing.

Part 2

Modify your program so that it prints the word containing the last occurrence the character. To stop printing after the first word, test for a space a period, or a NULL after outputting each character.

Reference no: EM132194492

Questions Cloud

Transfer of training process : Is Baldwin and Ford's model of the transfer of training process is effective?
Find an element in the array using binary search : Given an array of n integers, return the average number of comparisons that would be required to successfully find an element in the array using binary search.
What is the magnitude of the force exerted on the right cube : Three identical 5.0 kg cubes are placed on a horizontal friction less surface in contact with one another. The cubes are lined up from left to right.
Bird and wildlife hazard management at airport : Describe 6 keys activities of control techniques associated with bird and wildlife hazard management at airport?
Write a c language program that searches a string : Write a C language program that searches a string for the last occurrence of a specified character
Determine the value of the constant : A particle's velocity is described by the function vx=kt^2m/s, where vx is in m/s, t is in s, and k is a constant. The particle's position at t0=0s.
Positive and negative factors of using social media : What are positive and negative factors of using social media in hospitals?
What is the new range : In the absence of air resistance, a projectile is launched from and returns to ground level. It follows a trajectory similar to that shown in the figure.
Describe the employer mandate : Describe the employer mandate. What unintended behavioral change (by employers) do you think this mandate will cause?

Reviews

Write a Review

Computer Engineering Questions & Answers

  What subtree of binary search tree containing only equal key

What must a subtree of a binary search tree containing only equal keys look like in this case?

  Implement both approaches and examine their relative merits

Implement both approaches and examine their relative merits. Define suitable copy constructors and overloaded assignment operators.

  Which subnet mask should you select

Your company is assigned the network address 150.50.0.0. You need to create seven subnets on the network. A router on one of the subnets will connect the network to the Internet. All computers on the network will need access to the Internet. What ..

  Calculate the minimum required initial velocity

Calculate the minimum required initial velocity for a home run, for baseballs hit at the angles 10°, 20°, 30°, and 40° from the horizontal.

  How many comparisons of numbers are done in the worst case

Write an algorithm that accepts a weighted directed graph and finds the shortest path between any two vertices.

  Calculate and display a square matrix multiplication table

Calculate and display a square matrix multiplication table. For instance a sample output for a 4x4 table is listed below.

  Identify and analyze what you believe to be the most

write a four to five 4-5 page paper in which youidentify and analyze what you believe to be the most significant new

  Analyze your findings about one identified thief

Analyze your findings about one identified thief. How can you learn from your chosen thief to acknowledge and recognize the motives and behavioral indicators that someone might be spying against the company you work for?

  Design a structure in which the order of polling specified

The structure of Figure polls the peripheral devices in the order of the device numbers. Design a structure in which the order of polling (i.e., priorities).

  What is a processor and what components does it have

What is a processor? What components does it have? What makes a microprocessor different from the processor of a large computer?

  Write the sieve of eratosthenes as a generator function

Write a class named Permutation in a file named myPermutation.py that will generate on demand all the permutations of a given list.

  How would you challenge mpi to verify its claims

How would you challenge MPI to verify its claims regarding reducing turnover, increasing productivity, and decreasing stress and anger?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd