ISDS 505 Midterm 1 Chapter 4 Decisions (with 100% Errorless Answers)
What is the output of the following code segment? int a = 3, b = 4; if(a == b) Write("X"); WriteLine("Y"); a. X b. Y c. XY d. nothing correct answers b. Y What is the output of the following code segment? int a = 3, b = 4; if(a b) { Write("Y"); WriteLine("Z"); } a. Y b. Z c. YZ d. nothing correct answers c. YZ What is the output of the following code segment? int a = 3, b = 4; if(a b) Write("Up"); else WriteLine("Down"); a. Up b. Down c. UpDown d. nothing correct answers b. Down If the following code segment compiles correctly, what do you know about the variable x? if(x) WriteLine("OK"); a. x is an integer variable b. x is a Boolean variable c. x is greater than 0
Información del documento
- Subido en
- 5 de abril de 2024
- Número de páginas
- 5
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas