Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Name this program one. c - Complete the program shown below. #include #include typedef struct letter { char ch; struct letter *next; } Letter; int
Name this program one. c - Complete the program shown below. #include #include typedef struct letter { char ch; struct letter *next; } Letter; int main(void) { Letter a, b, c, d, e, f, g, h, i; a.ch ='D'; a.next = &b; b.ch ='0'; b.next = &c; c.ch ='R' ; c.next = &d; d.ch = 'M' ; d.next= &e; e.ch = 'I' ; e.net = &f; f.ch = 'T' ; f.next = &g; g.ch = 'O'; g.next = &h; h.ch = 'R'; h.next = ei; i.ch = 'Y' ; i.next = NULL; Letter *ptr = &a; while (ptr != NULL ) { printf ("%c", ptr->ch); ptr = ptr->next; } printf(" "); // rearrange pointers so that it spells "DIRTYROOM" ptr = &a; while (ptr != NULL ) { printf("%c", ptr->ch); ptr = ptr->next; } printf(" "); return 0; } Name this program two. c - In your one. c program, replace the line shown in blue below with the line shown in red. Modify the rest of your program (including insertion of the necessary malloc statements) so that your program runs the same as your one. c program runs. Name this program three.c - Repeat program two.c using an array of thirteen "Letters" that initially contains the phrase ELEVENPLUSTWO (allocate space, assign values, print the list). Then modify pointers in the data array so that it says TWELVE PLUS ONE. Print this revised list. Letter *data[13]; For all problems, modify pointers to transform the word. Modifying character values is unacceptable
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started