Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please include extensive comments. Question 1. Characters Merge (50 points) Write a C program to accept two string letters input and merge them as an

Please include extensive comments.

image text in transcribed

Question 1. Characters Merge (50 points) Write a C program to accept two string letters input and merge them as an ascending alphabet string and display it on screen. Suppose two input string letters have been sorted as ascending order already. For instance, abcdef is a string letter on its ascend order and neither bacdef nor abcdfe is qualified; Also, either Aa or Ab is an alphabetically ascending while neither aA nor bA is. You only consider arn ascending string for input. Design a function to merge these two characters into one according to ascending order. Name your program file Hw4_q1_code.c. Requirements are following: Not allowed to use any library function in head files that merge two strings or sort a string directly in an alphabetical order. You can use library functions within the scope of , and . Write the merge function by yourself. You can use scanf/gets function to accept input. 1. 2. Sample input: Please type in 1st characters: abcdef Please type in 2nd characters: bcefghi Sample output: After merge: abbccdeeffghi Please type in 1st characters abcdef Please type in 2nd characters: bcefghi After Merge: abbccdeeffghi Hint: char a, b. Figure out a mechanism deciding which one is bigger. See Professor's Ch5 slides. Understand what ASCIl is and how a C string terminates

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

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

Do you agree that unions stifle creativity? Why or why not?

Answered: 1 week ago

Question

6 What is the selection phase?

Answered: 1 week ago