Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

1) The following program compiles and runs without errors. What will get printed? #include void swap1(int a, int b){ int temp = a; a =

1) The following program compiles and runs without errors. What will get printed? #include void swap1(int a, int b){ int temp = a; a = b; b = temp; } void swap2(int a[], int b[]){ int temp = a[0]; a[0] = b[0]; b[0] = temp; } void swap3(int *a, int *b){ int temp = *a; *a = *b; *b = temp; void main(void) { } int a[2] = {2, 6); int b[2] = {0, 4}; swap1(a[0], a[1]); printf("%d, %d\ ", a[0], a[1]); Write your answer here. Solution: //2, 6 //0, 6, 2, 4 //4, 2 swap2(a, b); printf("%d, %d, %d, %d \ ", a[0], a[1], b[0], b[1]); swap3(&b[0], &b[1]); printf("%d, %d\ ", b[0], b[1]); (NO CHANGE) (a - {0, 6), b = {2,4}) (b = {4, 2})

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago