Looking for Computer systems test answers and solutions? Browse our comprehensive collection of verified answers for Computer systems at moodle.epfl.ch.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Consider the following C program:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double* f(double* q) {
q = malloc(sizeof(double));
*q = log(3.0); // 1.098612
return q;
}
int main(void) {
double x = 9.8;
double* ptr1 = &x;
double* ptr2 = f(ptr1);
printf("%f\n", *ptr2);
free(ptr1);
return 0;
}
Tick all the correct statements.Penalty for wrong ticks.
Consider the following C program:
#include <stdio.h>
#include <stdlib.h>
void f(int* q) {
q = malloc(sizeof(int));
*q = 45;
}
int main(void) {
int i = 3;
int* ptr = &i;
f(ptr);
printf("%d %d\n", i, *ptr);
return 0;
}
Tick all the correct statements.Penalty for wrong ticks.
Why might an end-system send an Address Resolution Protocol (ARP) message?
(Many answers may apply.)
In which case(s) does a link-layer switch broadcast a packet?
(Many answers may apply.)
Which of the following statements about forwarding tables are true?
Which of the following statements about IP forwarding tables are true?
(Many may be true.)
Which of the following statements about the Address Resolution Protocol (ARP) are true?
(Many may be true.)
What would happen if IP addresses were flat, hence not location-dependent?
Which of the following statements about MAC addresses are true?
Based on what we said in class, which of the following statements are true?
(Many may be true.)