HKOI2018 Junior Heat Event Exercise

A vibrant and engaging illustration of a computer screen displaying coding questions, with colorful abstract representations of programming elements like variables, loops, and logic operators in the background.

Evaluate Your Programming Knowledge

Test your understanding of programming concepts with our fun and challenging quiz! Covering a variety of topics, this quiz is perfect for budding programmers and seasoned coders alike.

Quiz Highlights:

  • 15 Thought-Provoking Questions
  • Covers Boolean Logic, Data Types, and Programming Output
  • Engaging Multiple Choice Format
15 Questions4 MinutesCreated by CodingWizard42
Question 1
 
Suppose x is a boolean variable. Evaluate the following expression.
(x && (!x)) == true
T
F
Question 2
 
The range of a double precision floating point (double) variable is larger than the range of a single precision floating point variable (float).
T
F
Question 3

A variable can be named go or ho but not do in C language.

T
F
Question 4
 
A program with 100 lines of code must takes a longer time to execute than a program with 10 lines of code.
T
F
Question 5

Given n is an integer, n/2 is always less than or equal to n/2.0

T
F
Question 6

Assume function random(n) returns an integer from 0 to n-1 randomly with equal probability. Consider the following program:

int a, b;
int main() {
    a = random(10) * 2;
    b = random(1) + random(5);
    printf(“%d”, b – a);
}

What is the number of possible different outputs?

A. 22
B. 23
C. 24
D. 25
Question 7
Given that there is only one correct answer for this question, which one is the correct answer?
A. Neither B nor C is the correct answer.
B. Neither C nor D is the correct answer.
C. Trust me, this is the correct answer.
D. Neither A nor B is the correct answer.
Question 8

a, b and c are integers. Consider the following program segment:

c = b;
b = a;
a = b;

At the end of the program segment, which of the following must be true?

  1. a == b
  2. b == c
  3. a == c
A. I only
B. Ii only
C. I and ii only
D. I, ii and iii
Question 9

In international chess, a bishop can move to any cell in 4 diagonal directions. Given that there is only one bishop on the chessboard and it is positioned at (1, 2), which of the following cells could it visit in arbitrary number of steps?

  1. (1, 2)
  2. (3, 3)
  3. (2, 7)
A. I only
B. Iii only
C. I and iii only
D. I, ii and iii
Question 10

Reference: HKOI2015 Junior Q25 Modified

Which of the following program segment(s) will output OIOIOIOI?

Program segment (1)

for (i = 1; I <= 8; i++)
if (i % 2 == 0)
    printf("I");
else
printf(“O");

Program segment (2)

    for (i = 1; I <= 4; i++)
        printf("O");
        printf("I");
 
A. None of the above
B. (1) only
C. (2) only
D. (1) and (2)
  1. Question 11

Reference: HKOI2015 Junior Q14 Modified

For integers a, b, c and d, it is given that:

        a > b

        c < b

        d > c

Which of the follow relation(s) can be deduced?

  1. a < c
  2. a > d
  3. b = d
  4. b < d
A. None of the above
B. Ii only
C. I and iii only
D. Ii and iv only
Question 12

The following is the true table for operator ◊:

A

B

A◊B

T

T

T

T

F

T

F

T

T

F

F

F

Simplify the following Boolean expression, where U and V are Boolean variables

        (U ◊ V) ◊ (NOT V)

  1. T
  2. F
  3. U
  4. V
A. T
B. F
C. U
D. V
Question 13

Evaluate the expression.

312 / 13 % 4 / 3

A. 0
B. 1
C. 2
D. 4
Question 14

What is the output of the following program?

#include <stdio.h>
int main() {
    printf(“H”);/*printf(“K”);
  //printf(“O”);  printf(“I”);
    printf(“2”);*/printf(“0”);
  //printf(“1”);  printf(“8”);
    return 0;
}
A. H2
B. H0
C. HI28
D. HKOI2018
Question 15

Given x and y are non-negative integers, what is the largest integer that cannot be obtained from 3x+7y?

A. 5
B. 7
C. 11
D. 13
{"name":"HKOI2018 Junior Heat Event Exercise", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your understanding of programming concepts with our fun and challenging quiz! Covering a variety of topics, this quiz is perfect for budding programmers and seasoned coders alike.Quiz Highlights:15 Thought-Provoking QuestionsCovers Boolean Logic, Data Types, and Programming OutputEngaging Multiple Choice Format","img":"https://cdn.poll-maker.com/104-5108656/img-zqmdr3sh6zfcpies3ppwejzp.jpg"}
Powered by: Quiz Maker