Question: nclude int main(void) char *ch *ch-malloc(sizeof(char)*2); ch[ 1 ]='3'; ch[2] a' while (ch[]> 0) printf(Character: %c and %cin, ch[l], ch[2]); ch[1] printf(main:00pin ch%pin ch-I %pin

 nclude int main(void) char *ch *ch-malloc(sizeof(char)*2); ch[ 1 ]='3'; ch[2] a'

nclude int main(void) char *ch *ch-malloc(sizeof(char)*2); ch[ 1 ]='3'; ch[2] a' while (ch[]> 0) printf("Character: %c and %cin", ch[l], ch[2]); ch[1] printf("main:00pin ch%pin ch-I %pin ch +2%pin "&main,ch.ch+1.ch+2); return ch[l)]: # include # include #include-malloc.h> int main(void) char *s, "dyn_s; int In; printf"Enter the input string n" scanf("%s",s); In = strlen(s); "dyn s-(char*)malloc(strlen(s)+1) dyn-s-s; dyn-s[strlen(s)] 0'; printfdyn_s); return 0; Please make these programs faults and comment in the code e the changes. work with no errors or seg xpaining why you made

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