Question: Problem 1 ( 2 points ) : Write a program that asks the user to input a string ( or no more than 5 0

Problem 1(2 points): Write a program that asks the user to input a string (or no more than 50 characters). Your program should then output the length of the string. The string length should be determined using a separate function strlen that will accept the address of the string and return its length. For the purposes of this exercise, the length of a string will be defined as the number of non-null and non-newline characters until either the null character (ASCII 0) or the newline character (ASCII 10) is encountered.
Problem 2(3 points): Write a program that defines two integer array that are pre-sorted and the same size (e.g.,[3,7,9,11,15,21] and [1,4,6,14,18,19]) and a function merge that takes the two arrays (and their size) as inputs and populates a single array of twice the size of either input array that contains the elements of both arrays in ascending order. In the example arrays given, then output would be [1,3,4,6,7,9,11,14,15,18,19,21]. Have your 'main' function (not the merge function) print out the final array using a comma as a delimiter.

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!