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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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