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

  Develop rwd for your microsite and use bootstrap framework

Develop RWD for your microsite and use the bootstrap framework to implement it. Explain the message that you want to communicate through your microsite.

  Append a flowchart based on the algorithm

Append a flowchart based on the algorithm for the revised program needs. Add this to the revised program flowchart from the Week One Individual Assignment.

  Write down a 200- to 300-word essay in response to the

write a 200- to 300-word essay in response to the following conflict resolution strategies help minimize the time

  Write single page web application

Write single page web application that will receive incoming POST and GET requests. If it is a POST request it should say at the top of the page.

  Why we cannot apply likelihood weighting to markov networks

Explain intuitively why we cannot simply apply likelihood weighting to Markov networks. Show how likelihood weighting can be applied to chordal Markov networks.

  Question1 how many hops are there from one node to another

question1 how many hops are there from one node to another? make up a detailed board.2 what are all of ip addresses?

  Name an instruction used to call a subroutine

Name an instruction used to call a subroutine. Name the register(s) that change(s) in value after the instruction is executed.

  Draw a venn diagram for each function in given problem

Draw a Venn diagram for each function in problem.

  Load the file into the parallel arrays

Load the file into the parallel arrays and show the list of customers` names and phone numbers in the alphabetical order.

  Design a simple single-channel dma controller

Design a simple, single-channel DMA controller for the 68000 using SSI and MSI logic. The DMAC has a two-wire interface to the peripheral, consisting of REQ*.

  Describe one application relevant for ig based energy system

IGs need dc-ac, ac-dc, and ac-ac converters. Describe one application, relevant for IG-based energy system, for each of those power conversions.

  As a member of an it staff how can you use social media to

question 1. as a member of an it staff how can you use social media to support e-commerce? you can search business

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