• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 7 páginas
Examen

CS 220 Final Study Guide || A+ Verified Solutions.

Document preview thumbnail
Vista previa 2 fuera de 7 páginas

#define FOO(a, b) ((a x a) + (b x b)) ... printf("%d", FOO(1, 2+3); What is printed out? a. 22 b. 24 c. 26 d. 12 correct answers d What is the output of the following code snippet? ... int arr[] = {1, 2, 3, 4}; int i, sum; for (i = 0, sum = 0; i 4, i++){ sum += arr; arr++; } ... a. compilation error b. segmentation error c. 10 d. 6 correct answers b If the function foo has the following signature: void foo(int a, int b, int c, int d); how is b passed to foo? a. In rdi b. In rsi c. In rbx d. On the stack correct answers b in Intel x86, stack pointer: a. stores the flag registers b. points the top of the program stack c. stores the stack variables d. servers as an accumulator correct answers b In 32 bit IEEE 754 floating point standard, how many bits are reserved for exponent and precision? a. 9 and 22 b. 8 and 23 c. 8 and 24 d. 7 and 24 correct answers b

Vista previa del contenido

CS 220 Final Study Guide || A+ Verified Solutions.
#define FOO(a, b) ((a x a) + (b x b))
...
printf("%d", FOO(1, 2+3);
What is printed out?
a. 22
b. 24
c. 26
d. 12 correct answers d

What is the output of the following code snippet?
...
int arr[] = {1, 2, 3, 4};
int i, sum;
for (i = 0, sum = 0; i < 4, i++){
sum += arr;
arr++;
}
...
a. compilation error
b. segmentation error
c. 10
d. 6 correct answers b

If the function foo has the following signature:
void foo(int a, int b, int c, int d);
how is b passed to foo?
a. In rdi
b. In rsi
c. In rbx
d. On the stack correct answers b

in Intel x86, stack pointer:
a. stores the flag registers
b. points the top of the program stack
c. stores the stack variables
d. servers as an accumulator correct answers b

In 32 bit IEEE 754 floating point standard, how many bits are reserved for exponent and
precision?
a. 9 and 22
b. 8 and 23
c. 8 and 24
d. 7 and 24 correct answers b

, In 32 bit IEEE 754 floating point standard, which of the following bit patterns represents
+infinity?
a. 01111111100000000000000000000000
b. 01111111111100000000000000000000
c. 01111111111111111111111111111111
d. None of the other choices correct answers a

In 32 bit IEEE 754 floating point standard, which of the following bit patterns does not represent
NaN?
a. 11111111100000000000000000000000
b. 01111111100000000000000000000000
c. 01111111111111111111111111111111
d. Both a and b correct answers a because it is -infinity

Pick the most appropriate statement regarding structures in C.
a. Size of a structure in memory is exactly equal to the sum of its members
b. If a structure has 2 members, address of the 2nd member is always greater than the address of
the 1st member
c. The compiler may split a structure into multiple parts and allocate them on different pages to
optimize memory utility.
d. All structure must be typedefined using typedef correct answers b

In Intel x86:
a. Function arguments are pushed on the stack left to right
b. Function arguments are pushed on the stack right to left.
c. the order in which arguments are populated does not matter
d. Except variable argument functions like printf, arguments are pushed from left to right for all
other functions correct answers b

In the following code (assume syntactic correctness and no protections in place), buffer overflow
WILL NOT occur if:
int main(){
char s[A], d[B];
...
fgets(s, 128, STDIN);
strcpy(d, s);
...
}
a. if A <= B and B == 128
b. if B <= A and A == 128
c. if A > 128 and B > 128
d. if A >= 128 and B > A correct answers d because fgets reads in 128 bits in s, so A >= 128 and
d must be larger than s, so B > A

The following code:
...

Información del documento

Subido en
12 de marzo de 2025
Número de páginas
7
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$11.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
SirAnton
3.7
(118)
Vendido
810
Seguidores
438
Artículos
40067
Última venta
6 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes