Translate the complete program

Assignment Help C/C++ Programming
Reference no: EM132003888

Question: Project Description:

#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.

Reference no: EM132003888

Questions Cloud

Pursue holistic therapeutic approaches : What are some ways to assist hesitant to demonstrate the potential value of more holistic treatment?
What is social loafing : What is social loafing? Under what conditions are group members less likely to engage in social loafing?
Discuss how you think your theoretical preferences influence : On the basis of your understanding of the theoretical perspectives explored in this module, discuss what theoretical orientations you most closely align.
Appreciate the complex processes underlying : We fail to appreciate the complex processes underlying each of our senses, not to mention their integration.
Translate the complete program : Declare first2 and p2 to be local variables along with the other locals as follows: struct node *first, *p, *first2, *p; int value;
Describe one researched accounting position : Describe one (1) researched accounting position, and explain the essential skills that would make a candidate successful in the position
What does the term-personality-mean : Where does it come from? If you believe it develops (as opposed to being inherited and present at birth), what influences that development?
Prepare the entry to record the formation of the partnership : Prepare the entry to record the formation of the partnership, under the following methods: Capital accounts are set to equal net assets invested
Explores one of the case studies in given question : This will be a basic research paper that further explores one of the case studies at the end of the Chapter. Select one and see what information is available.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implement the default constructor

Implement the default constructor and the constructors with one and two int parameters. The one parameter constructor should initialize the first member of the pair; the second member of the pair is to be 0.

  Discuss about the member of the class buffered reader

Write some code that will create a stream named file In that is a member of the class Buffered Reader and that connects the stream to a text fi le named joe.

  Read in data from an input file (qstr.txt).

It will print the output and say that it is NOT palindrome which leads me to believe it is missing something somehow.

  All nodes of a binary tree need to fulfil

What properties do all nodes of a binary tree need to fulfil? Draw the binary tree for the following sequence of nodes, where all nodes must fulfil the properties for binary trees: 39, 22, 18, 10, 12, 30, 54, 48, 50, 89

  Prepare your own unique while-end repetition structure

Create your own unique While-End repetition structure. You decide the theme. You should provide both the pseudocode and the flowchart of your example.

  What do you need to declare in the class

Question: What do you need to declare in the class and define to accomplish the bk3 = bk1+bk2; successfully? Design the three classes . The classes must use appropriate relationships.

  Display the array, the average and the number of days above

Write a program that stores the daily temperatures for the month of April in an array name dailytemp. Calculate the average temperature for the month and the count the number of days that the daily temperature was above the average.

  Write an interactive program that prompts for a desired sum

Write an interactive program that prompts for a desired sum, then repeatedly rolls two six-sided dice until their sum is the desired sum. Here is the expected dialogue with the user.

  We have to deal with student pilots

We have to deal with student pilots and airplanes. Students have a unique student id, a name, and a year that students are in. Airplanes have a unique airplane id, model, a cruising range

  Extension of a filename

Modify your earlier program that found the extension of a filename. This time your program will identify a file name that is no longer that 12 characters and has one of five extensions that you specify (eg: .doc. .py, .html, .txt, .ps).

  Write the definition of a void function

Write the definition of a void function that takes as input two parameters of type int, say sum and testScore. The function updates the value of sum by adding the value of testScore. The new value of sum is reflected in the calling environment.

  Taskimplement class serial using serialcpp and serialh- the

taskimplement class serial using serial.cpp and serial.h- the function call operator is overloaded and will generate a

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd