Question
1) Translate the following flowchart to pseudocode. 2. Topics: Pointers, Linked-List, Scope, C-Function a) The following C program compiles, links without errors and should print
1) Translate the following flowchart to pseudocode.
2. Topics: Pointers, Linked-List, Scope, C-Function a) The following C program compiles, links without errors and should print CMP10, but it produces segmentation faults when we run it. Identify the TWO errors in the code and suggest minimal changes that would allow the program to execute successfully. Your changes should not alter the general structure of the program, i.e. it should still link the two nodes in the main program into a linked list and print it. Indicate the line of code of each error, describe the error and give the correct code.
1: #include
46: 47: // add x to front of strlist and return pointer to new list head 48: Node *push_node(Node x, Node *strlist) { 49: x.next= strlist; 50: return &x; 51: }
3. Based on the following program:
#include i) Identify the local variables ii) Identify the global variables iii) Identify the formal parameters iv) Identify the actual parameters v) What is the output of the above program?
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