Question: The following program is to be written in C programming and please keep in mind this is a first year programing course so it should
The following program is to be written in C programming and please keep in mind this is a first year programing course so it should use the hint provided at the end of the question. Thanks in advance for the answer.
Write a program that promts the user to enter a string of length n (let's call it originalS). It then prompts the user to enter exactly n integers, where n is the length of originalS and stores them in an array called num. The prgram then creates and prints a new string that consists of the letters in originalS (in that order) repeated by the number of times indicated by the element in num at the corresponding position of originalS. For example, if the user enters a string "hello", and the values of num entered are 2 1 3 0 1, then the output string is "hhelllo".
HINT: You need 2 arrays, 1 for string and 1 for how many times to print each letter.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
