• ¿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 3 fuera de 17 páginas
Examen

Cse 240 Updated 2026 Exam Script Questions And Solutions Rated

Document preview thumbnail
Vista previa 3 fuera de 17 páginas

CSE 240 UPDATED 2026 EXAM SCRIPT QUESTIONS AND SOLUTIONS RATED

Vista previa del contenido

CSE 240 UPDATED 2026 EXAM SCRIPT QUESTIONS AND
SOLUTIONS RATED A+
✔✔Assume a varible is declared in a block of code within a pair of curly braces. The
scope of the variable - ✔✔starts from its declaration point and extends to the end of the
block.

✔✔Given a C declaration: char a[] = "Hello World"; What can be used as the initial
address of array a[]? Select all correct answers. - ✔✔*a[0]
&a[0] (check with professor)

✔✔Given a declaration: char a[] = "Hello World"; What is the size (in bytes) of the array
a[]? - ✔✔12 bytes

✔✔Which of the following C assignment statements (assign a value to a variable at the
semantic level) will NOT cause a compilation error?

Assume the array has been declared as: char a[5]; - ✔✔a[0] = 'h';

✔✔Which of the following statements will assign the address of the variable int myInt to
the pointer int* myPtr? - ✔✔int* myPtr = &myInt;

✔✔Given the following:

int num1 = 5; //addressed at 1877112
int num2 = 15; //addressed at 1877300
int num3 = 20; //addressed at 1877192
double d1 = 1.05; //addressed at 1374376
double d2 = 2.25; //addressed at 1374360
double d3 = 3.14; //addressed at 1374344

After these statements:

int* ptr1 = &num3
ptr1 = ptr1 + 5;

What will be the address contained in ptr1? - ✔✔1877212

✔✔Which of the following statements will allow me to give the value of 10 to the
memory int* myPtr points to? - ✔✔*myPtr = 10;

✔✔int num1 = 5; //addressed at 1767612

int num2 = 10; //addressed at 1767600

,int num3 = 15; //addressed at 1767588

char ch1 = 'a'; //addressed at 3734375

char ch2 = 'b'; //addressed at 3734363

char ch3 = 'c'; //addressed at 3734351

char* chPtr = &ch3;

int* iPtr = &num3;

*iPtr = num3 *(times) 8;

'*chPtr' = '*iPtr;'

What will the following statement output?

cout << ch3; - ✔✔'x'

✔✔(True or False) Multiple pointers can reference the same objects. - ✔✔True

✔✔C/C++ has 2 pointer operators, which operator represents the name of the address?
(Commonly refer as l-value.) - ✔✔Asterisk (*)

✔✔Given this snippet of code, what is the value of x after executing the last statement?

int x = 10, *y;

y = &x;

y = y + 1;

*y = 100; - ✔✔10

✔✔Given this snippet of code, what is the value of x after executing the last statement?

int x = 10, *y;

y = &x;

*y = 100; - ✔✔100

✔✔Given this snippet of code, what is the value of z after executing the last statement?

, int x = 10, *y, **z;

z = &y;

y = &x;

*y = 100; - ✔✔None of the above (Memory Address)

✔✔A pointer variable can take the address of a memory location as its value. Read the
given program.



#include <stdio.h>
main() {
int a = 20, b = 30, *p, *q, **r;
p = &a;
*p = 50;
q = &b;
*q = 70;
r = &p;
**r = 90;
printf("%d\n", a); // 1st printf statement
printf("%d\n", b); // 2nd printf statement
a = 20;
b = 80;
printf("%d\n", **r); // 3rd printf statement
}

Answer the following three questions.

1.The output of the 1st printf statement is [first].

2. The output of the 2nd printf statement is [second].

3.The output of the 3rd printf statement is [third]. - ✔✔1.The output of the 1st printf
statement is Correct 90.

2. The output of the 2nd printf statement is Correct 70.

3.The output of the 3rd printf statement is Correct 20.

✔✔We use "Pass by Constant Reference" when: - ✔✔Function does not want to modify
the value, the value is expensive to copy and NULL is not valid

Información del documento

Subido en
6 de abril de 2026
Número de páginas
17
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$13.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.
EXAMCAFE
3.5
(43)
Vendido
298
Seguidores
11
Artículos
36883
Última venta
1 semana 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