1. If the chararray stg is set to “ Moonlight Sonata “ in a program, reassign stg after removing all leading and trailing whitespace from the string. 2. Write a program that accepts an integer...


1. If the chararray stg is set to “ Moonlight Sonata “ in a program, reassign stg after removing all leading and trailing whitespace from the string.


2. Write a program that accepts an integer between 1 and 12 from the keyboard and prints the fi rst three letters of the corresponding month. For instance, keying in 3 should print Mar. All month names must be extracted from a single string without using an if or switch statement.


3. Develop a function named char_replace(s, c1, c2) which replaces all occurrences of the character c1 in the string s with c2 and returns the number of characters replaced.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here