Question: Short code questions 1 Write a function that adds up digits in a string. If a string contains a digit ( 0 - 9 )

Short code questions 1
Write a function that adds up digits in a string. If a string contains a
digit (0-9) add it to the sum value and return the sum. You cannot
use string.h or ctype.h.
Short code questions 2
Allocate sufficient memory in the following code example:
#include
#include
char **string_duplication(char *input_string, int string_length, int num_dup){
// return an array containing the string repeated num_dup times
char **arr_dups;
// Allocate memory here
for(int i=0; i
#include
char **string_duplication(char *input_string, int string_length, int num_dup){
// return an array containing the string repeated num_dup times
char **arr_dups;
// Allocate memory here
for(int i=0; i

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 Finance Questions!