Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following C code: void swap( int x, int y ){ int t= x; x= y; y= t; } int main(){ int a= 10;

Given the following C code:

void swap( int x, int y ){ int t= x; x= y; y= t; } int main(){ int a= 10; int b= 20; swap( a, b ); printf( "a = %d, b = %d ", a, b ); } 

Part 1:

What will the printf function output as the value of variable 'a'? ANSWER IN DECIMAL!!! DO NOT INCLUDE THE TEXT OF THE PRINTF STATEMENT, JUST THE VALUE OF VARIABLE 'a' THAT IS OUTPUT!!!!!!

Part 2:

True or false: Assuming that the first parameter is in %rdi and the second parameter is in %rsi, the following assembly is produced when the swap function is compiled:

 movl (%rdi),%eax movl (%rsi),%edx movl %edx,(%rdi) movl %eax,(%rsi) retq 

ANSWER ONLY 'TRUE' OR 'FALSE'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

Students also viewed these Databases questions

Question

3. Move smoothly from point to point

Answered: 1 week ago

Question

6. Effectively perform the managers role in career management.

Answered: 1 week ago