computer
#include
#include
struct node {
int data;
struct node *next;
};
int main() {
struct node *first, *p, *first2, *p2;
int value;
first = 0;
scanf ("%d", &value);
while (value != -9999){
p = first;
first = (struct node *) malloc (sizeof(struct node));
first -> data = value;
first -> next = p;
scanf("%d", &value);
}
for (p = first; p != 0; p = p -> next){
printf("%d ", p -> data);
}
first2 = 0; p2 = 0;
for (p = first; p != 0; p = p -> next){
p2 = first2;
first2 = (struct node *) malloc (sizeof(struct node));
first2 -> data = p -> data;
first2 -> next = p2;
}
for (p2 = first2; p2 != 0; p2 = p2 -> next){
printf("%d ", p2 -> data);
}
printf("\n");
return 0;
}
Declare first2 and p2 to be local variables along with the other locals as follows:
struct node *first, *p, *first2, *p;
int value;
Translate the complete program to pep/9 assembly language.
8 years ago
8
- HRM 300 Week 5 Employee Training & Career Development Paper
- COMM 105 Week 5 Individual Assignment Persuasive Essay
- CMGT 410 Week 1 Individual Project Proposal
- MKT 450 Week 5 Individual FINAL International Marketing Ethics Paper
- Engineering economy online class
- Simulate the operations of an ATM machine. First, the customer is prompted to enter his personal identification number pin (for...
- ISCOM 305 Week 2 Team Assignment - Parker Earth Moving Company Consulting Session 1
- Philosophy HWBased on articles 4.1 and 4.2 [200 words or less in the body of your email].Should we just outlaw...
- Dotcom.com
- ACC 421 Final Exam