3- [20p] [0xbaf79] Explain the code according to comment line shown below. The Explanation must contain the flows of the code. Only Line by line code explanations are Not acceped!!. Only General explanations are NOT accepted. Write screen output [5p] and explain how the code works!! and code flows, variables status/changes etc. according to your student id. Explain the code with real example. DO NOT TEST THE CODE IN COMPUTER!! #include //Prototypes void q1 (int a, int b); void q2 (int a[ ], int b[ ]); void q3 (int *a, int *b); int main() { //20051XYZT This is your student number, Put real numbers //instead of X, Y, Z, T numbers int a [2] = {X, Y); int b[2] = {Z, T);

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Can you give me a simple explanation of how this code works?

n
3-[20p] [Oxbaf79] Explain the code according to comment
line shown below. The Explanation must contain the flows
of the code. Only Line by line code explanations are Not
acceped!!. Only General explanations are NOT accepted.
Write screen output [5p] and explain how the code works!!
and code flows, variables status/changes etc. according
to your student id.
Explain the code with real example.
DO NOT TEST THE CODE IN COMPUTER!!
d
#include <stdio.h>
//Prototypes
void q1 (int a, int b);
e
void q2 (int a[ ], int b[ ]);
void q3 (int *a, int *b);
5
int main() {
//20051XYZT This is your student number, Put real numbers
//instead of X, Y, Z, T numbers.
int a [2] = {X, Y);
int b[2]
{Z, T};
q1 (a [0], b[1]);
q2 (a, b);
q3 (&b [0], &a [1]);
printf ("%d, %d, %d, %d \n", a[0], a[1], b[0], b[1]);
return 0; }
//functions.
void q1 (int a, int b) {
int temp = a;
if (a%2==0) {a = b*2; } else {a=b+5; }
b = temp+3; }
void q2 (int a[ ], int b[ ]) {
int temp = a [0];
if (b[1]%2==0) { a [0]
else {a [0]=b[0] *2; }
b[0] = temp/2; }
void q3 (int *a, int *b) {
int temp = *a;
if (temp<*b) {*a = *b;
*b = temp; }
= b[0] +a[1]; }
Transcribed Image Text:n 3-[20p] [Oxbaf79] Explain the code according to comment line shown below. The Explanation must contain the flows of the code. Only Line by line code explanations are Not acceped!!. Only General explanations are NOT accepted. Write screen output [5p] and explain how the code works!! and code flows, variables status/changes etc. according to your student id. Explain the code with real example. DO NOT TEST THE CODE IN COMPUTER!! d #include <stdio.h> //Prototypes void q1 (int a, int b); e void q2 (int a[ ], int b[ ]); void q3 (int *a, int *b); 5 int main() { //20051XYZT This is your student number, Put real numbers //instead of X, Y, Z, T numbers. int a [2] = {X, Y); int b[2] {Z, T}; q1 (a [0], b[1]); q2 (a, b); q3 (&b [0], &a [1]); printf ("%d, %d, %d, %d \n", a[0], a[1], b[0], b[1]); return 0; } //functions. void q1 (int a, int b) { int temp = a; if (a%2==0) {a = b*2; } else {a=b+5; } b = temp+3; } void q2 (int a[ ], int b[ ]) { int temp = a [0]; if (b[1]%2==0) { a [0] else {a [0]=b[0] *2; } b[0] = temp/2; } void q3 (int *a, int *b) { int temp = *a; if (temp<*b) {*a = *b; *b = temp; } = b[0] +a[1]; }
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY