Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming problem. Sample output shown LAB 9 HOMEWORK ASSIGNMENT to be turned in In this assignment, you will work with strings and hence character

C programming problem. Sample output shown

image text in transcribedimage text in transcribedimage text in transcribed

LAB 9 HOMEWORK ASSIGNMENT to be turned in In this assignment, you will work with strings and hence character arrays), and will manipulate them using pointers as well functions from the standard string library (string.h). Specifically, your task is to write a program that does all of the following: 1. Reads two strings from the user 2. Compares the lengths of the strings and determines which is the longer one, i.e. contains more characters. For example, "Hello there is longer than "Hello 3. Determines whether the shorter string is a prefix of the longer string. For example, "He is a prefix of "Hello there!". 4. Determines whether the shorter string is a suffix (or postfix) of the longer string. For example, "here" is a suffix of "Hello there" 5. Determines the number of times that the shorter string occurs in the longer string. For example, string "bra" occurs 2 times in string "abracadabraa". 6. Counts the number of words in the longer string. In this assignment, we assume a word is any sequence of characters that does not contain any white space characters (i.e. space, tab, or newline). IMPORTANTGUIDELINES 1) The user will be prompted to enter each string on a separate line and might contain spaces. Therefore you may not be able to use scanf and you will need to instead use gets (or fgets to read them

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions