Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 4 fuera de 44 páginas
Examen

Test Bank For Absolute C++ 26th Edition All Chapters - 9780133970838.pdf

Document preview thumbnail
Vista previa 4 fuera de 44 páginas

Test Bank For Absolute C++ 26th Edition All Chapters -

Vista previa del contenido

1. What is the output of the following C code snippet?
n n n n n n n n n n




#include <stdio.h> n




int main() { printf("Hello,
n n n


world!"); return 0;
n n n

}

A. Hello, world! n


B. Hello
C. world
D. Compile-
time error Answer: A.
n n n


2. Which of the following is NOT a valid C identifier?
n n n n n n n n n n


A. my_var
B. _myVar
C. 1_myvar
D. myVar1
nAnswer: C n


.
3. What is the output of the following C code snippet? arduino
n n n n n n n n n n n




#include <stdio.h> n




int main() { in
n n n


t x = 5;
n n n


printf("%d", x++); n


printf("%d", x); ret n n


urn 0; n

}
A. 56
B. 55
C. 65
D. 6
Answer: A. n


4. Which of the following is the correct syntax for declaring a function
n n n n n n n n n n n n n


that takes two integer parameters and returns an integer?
n n n n n n n n


A. intmyFunction(int x, int y) { return x + y; } n n n n n n n n n


B. function(int x, int y) int { return x + y; } n n n n n n n n n n


C. int function myFunction(int x, int y) { return x + y; }
n n n n n n n n n n n


D. int myFunction(int x int y) { return x + y; }
n n n n n n n n n n n


Answer: A. n


5. What is the output of the following C code snippet?
n n n n n n n n n n

,#include <stdio.h> n




int main() {
n n


int arr[] = {1, 2, 3, 4, 5};
n n n n n n n


printf("%d", arr[2]); ret n n


urn 0; n

}
A. 1
n


B. 2
n


C. 3
n


D. 4
n


Answer: C. n


6. Which of the following operators can be used to obtain the address of
n n n n n n n n n n n n n n


a variable in C? n n n


A. &
n


B. *
n


C. +
n


D. -
n


Answer: A. n


7. What is the output of the following C code snippet?
n n n n n n n n n n




#include <stdio.h> n




int main() {
n n


int x = 5, y = 7; printf("%d"
n n n n n n n


, x > y ? x : y); return 0;
n n n n n n n n n


}

A. 5
B. 7
C. 12
D. Compile-
time error Answer: B.
n n n


8. Which of the following statements about arrays in Cis FALSE?
n n n n n n n n n n


A. An array is a collection of elements of the same data type.
n n n n n n n n n n n


B. The size of an array must be specified at the time of declaration.
n n n n n n n n n n n n


C. The index of the first element of an array is always 0.
n n n n n n n n n n n


D. The elements of an array can be of different data types.
n n n n n n n n n n n


Answer: D. n


9. What is the output of the following C code snippet? arduino
n n n n n n n n n n n

,#include <stdio.h> n




int main() {
n n


int arr[] = {1, 2, 3, 4, 5};
n n n n n n n


int *p = arr; printf("%d
n n n n


", *(p + 3)); return 0;
n n n n n

}

A. 1n


B. 2n


C. 3n


D. 4n


Answer: D. n


10.Which of the following is the correct syntax for declaring a pointer to
n n n n n n n n n n n n n


an integer in C? n n n


A. int *p; n


B. int p; n


C. *int p; n


D. pointer int p; n n n


Answer: A. n


11.What is the output of the following C code snippet?
n n n n n n n n n


ini

#include <stdio.h> n




int main() { int
n n n


x = 5; int *p
n n n n n


= &x;
n n


*p = 7; printf("%d
n n n


", x); return 0;
n n n

}

A. 5
B. 7
C. Compile-time error n


D. Run-
time error Answer
n n


: B.
n


12.Which of the following is the correct syntax for a while loop in C?
n n n n n n n n n n n n n


A. while (condition) { statement; }
n n n n


B. while (statement) { condition; }
n n n n


C. for (statement; condition; increment) { }
n n n n n


D. do { statement; } while (condition);
n n n n n n


Answer: A. n

, 13.What is the output of the following C code snippet? arduino
n n n n n n n n n n




#include <stdio.h> n




int main() {
n n n


int x = 5;n n n n


int y = 7;n n n


printf("%d", x & y); n n n n


return 0; n


}
A. 0 n


B. 1 n


C. 5 n


D. 7 n


Answer: A. n


14.Which of the following is the correct syntax for a switch sta
n n n n n n n n n n n


tement in C? n n


A.

switch (expression) {n n n


case constant1: statem
n n


ent1;
break;
case constant2: sta
n n


tement2; break; n


default:
statement3;
}

B.

switch (expression) cn n


ase constant1: n


statement1; brea n


k;
case constant2: stan n


tement2; break; n


default:
statement3;

C.

Libro relacionado
 image
Walter Savitch, Kenrick Mock Absolute C++
Edición: 2015 ISBN: 9780133970784 Edición: Desconocido

Información del documento

Subido en
9 de abril de 2025
Número de páginas
44
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$21.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.
STUVIATESTBANKSS
4.6
(356)
Vendido
7
Seguidores
5
Artículos
470
Última venta
2 meses hace


Reseñas de compradores verificados



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