50 multiple-choice questions with answers and detailed explanations. Untimed — choose an answer to check it instantly.
0/50 answered0 correct
Question 1 of 50
What are the basic instruction types of a computer program?
Correct answer: D) Input, process, output
Explanation: A computer program typically involves three basic instructions: input, process, and output. The input gathers data, processing manipulates it, and output delivers the result.
Question 2 of 50
What is a variable in programming?
Correct answer: C) A reference to data whose value can change during program execution
Explanation: A variable refers to data that programs use, and its value can change as the program runs, hence the name "variable."
Question 3 of 50
What is the equation for a triangle’s area?
Correct answer: C) Base x Height / 2
Explanation: The area of a triangle is calculated by multiplying its base by its height, then dividing by 2.
Question 4 of 50
How do you find the average of a set of numbers?
Correct answer: D) Sum the numbers and divide by the total number of values
Explanation: The average is found by adding all the numbers together and then dividing by the number of values in the set.
Question 5 of 50
What is computational thinking?
Correct answer: C) Creating a sequence of instructions to solve a problem
Explanation: Computational thinking involves formulating problems and their solutions in a way that a computer can execute the steps efficiently.
Question 6 of 50
What is an algorithm?
Correct answer: C) A sequence of instructions that solves a problem
Explanation: An algorithm is a step-by-step sequence of instructions designed to perform a specific task or solve a particular problem.
Question 7 of 50
What is a flowchart?
Correct answer: B) A graphical language for creating programs
Explanation: A flowchart is a diagram that represents a process, showing the steps using various shapes and arrows to demonstrate the flow of control.
Question 8 of 50
What is a program?
Correct answer: B) A list of statements that execute one at a time
Explanation: A program is a collection of instructions or statements executed by the computer to perform a specific task.
Question 9 of 50
What tool runs a program’s statements?
Correct answer: C) Interpreter
Explanation: An interpreter executes program instructions one at a time, as opposed to a compiler, which translates the entire program before execution.
Question 10 of 50
What is a specific action in a program called?
Correct answer: B) Statement
Explanation: A statement is an instruction in a program that performs a specific action, such as assigning a value to a variable or calling a function.
Question 11 of 50
What shape is used for an input/output statement in a flowchart?
Correct answer: D) Parallelogram
Explanation: In a flowchart, a parallelogram is used to represent input or output operations.
Question 12 of 50
What represents a new line in programming?
Correct answer: A) \n
Explanation: The escape sequence "\n" is used in programming languages to create a new line in the output.
Question 13 of 50
What is a comment in a program?
Correct answer: C) Text added by the programmer for human understanding
Explanation: Comments are added to code for clarity and are ignored by the program during execution. They help others understand the code better.
Question 14 of 50
What should not include whitespace in programming?
Correct answer: B) Variable names and digits of a number
Explanation: Variable names and digits in numbers should not include any whitespace, as this would create a syntax error in most programming languages.
Question 15 of 50
When did the industrial age start?
Correct answer: B) Late 1700s
Explanation: The industrial age began in the late 1700s with the advent of machinery and manufacturing processes.
Question 16 of 50
When did the information age start?
Correct answer: B) 1990s
Explanation: The information age, marked by the rise of the internet and computer technology, began in the 1990s.
Question 17 of 50
What is an embedded computer?
Correct answer: B) A computer inside another device
Explanation: Embedded computers are found within other devices, such as cars, TVs, and home appliances, performing dedicated functions.
Question 18 of 50
What is a character in programming?
Correct answer: B) A letter, symbol, or digit
Explanation: A character represents a single letter, number, or symbol in text-based data.
Question 19 of 50
What does ASCII stand for, and when was it developed?
Correct answer: B) American Standard Code for Information Interchange, 1963
Explanation: ASCII is a character encoding standard developed in 1963 to represent text in computers and communication devices.
Question 20 of 50
How many bits per code does ASCII use?
Correct answer: B) 7 bits
Explanation: ASCII uses 7 bits to represent characters, allowing for 128 possible characters.
Question 21 of 50
What is Unicode, and when was it published?
Correct answer: B) A character encoding standard, 1991
Explanation: Unicode, published in 1991, provides a universal standard for character encoding, supporting more than 100,000 characters.
Question 22 of 50
What is pseudocode?
Correct answer: B) Text resembling code for easier understanding
Explanation: Pseudocode is a simple, informal description of what a program does, written in a way that humans can easily understand.
Question 23 of 50
What is an assignment statement?
Correct answer: B) Assigns a variable with a value
Explanation: An assignment statement is used to assign a value to a variable in programming, such as x = 5.
Question 24 of 50
What is a variable declaration?
Correct answer: B) Declares a new variable’s name and type
Explanation: A variable declaration specifies the type and name of a variable, telling the compiler to reserve memory for it.
Question 25 of 50
What is an identifier in programming?
Correct answer: B) A name created by a programmer for variables or functions
Explanation: An identifier is a unique name created by the programmer for variables, functions, or classes in a program.
Question 26 of 50
What is a reserved word (or keyword)?
Correct answer: B) A word that is part of the programming language
Explanation: Reserved words, or keywords, are predefined in a programming language and cannot be used as variable names or identifiers.
Question 27 of 50
What is a naming convention in programming?
Correct answer: B) A set of style guidelines for naming variables
Explanation: A naming convention is a set of rules that defines how to name variables, functions, or classes in a program.
Question 28 of 50
What is an expression in programming?
Correct answer: B) A combination of variables, literals, operators, and parentheses
Explanation: An expression in programming combines variables, constants, and operators to evaluate to a value.
Question 29 of 50
What is a literal in programming?
Correct answer: B) A specific value in code
Explanation: A literal is a fixed value written directly in the code, such as a number or string.
Question 30 of 50
What is an operator in programming?
Correct answer: B) A symbol that performs a calculation
Explanation: An operator is a symbol used in programming to perform calculations or operations on data, such as + for additio
Question 31 of 50
What is the order of precedence for arithmetic operators?
Correct answer: B) * / % + –
Explanation: The order of precedence dictates that multiplication, division, and modulus operators have higher precedence over addition and subtraction.
Question 32 of 50
What is incremental development?
Correct answer: B) Writing, compiling, and testing small amounts of code incrementally
Explanation: Incremental development is the process of writing and testing a small portion of code before moving on to the next portion.
Question 33 of 50
What is a floating-point number?
Correct answer: A) A real number like 98.6 or -5.5
Explanation: A floating-point number is a number that has a decimal point, allowing it to represent fractional values.
Question 34 of 50
What is a floating-point literal?
Correct answer: B) A number with a fractional part, even if that fraction is 0
Explanation: A floating-point literal is a numeric value that includes a decimal point, such as 3.0 or 0.5.
Question 35 of 50
What is the result of 12.0 / 0.0 in programming?
Correct answer: B) Positive infinity
Explanation: Dividing a non-zero floating-point number by 0 results in positive infinity.
Question 36 of 50
What is the result of 0.0 / 0.0 in programming?
Correct answer: C) NaN (Not a Number)
Explanation: Dividing 0.0 by 0.0 results in an undefined value, known as NaN (Not a Number).
Question 37 of 50
What is a function in programming?
Correct answer: B) A list of statements executed by invoking the function’s name
Explanation: A function is a block of organized, reusable code that performs a specific task when called.
Question 38 of 50
Which function returns the square root of x?
Correct answer: A) SquareRoot(x)
Explanation: The function SquareRoot(x) returns the square root of a given number x.
Question 39 of 50
How do you calculate the power of 4²?
Correct answer: C) 4 * 4
Explanation: To calculate the power of 4², you multiply 4 by itself, which equals 16.
Question 40 of 50
What does the SeedRandomNumber function do?
Correct answer: C) Seeds the random number generator
Explanation: SeedRandomNumber is used to seed the random number generator, ensuring the same sequence of random numbers is generated each time.
Question 41 of 50
What is integer division rounding in programming?
Correct answer: B) Performing division with integer results, ignoring fractions
Explanation: Integer division rounds down any fractional parts, producing only whole numbers as a result.
Question 42 of 50
What happens when you divide by zero in integer division?
Correct answer: C) It causes a divide-by-zero error
Explanation: In integer division, dividing by zero is mathematically undefined and results in a runtime error, terminating the program.
Question 43 of 50
What is type conversion?
Correct answer: B) Converting a data type to another, such as integer to float
Explanation: Type conversion occurs when one data type is converted to another, such as converting an integer to a float.
Question 44 of 50
What is type casting?
Correct answer: B) Converting a value of one type to another type
Explanation: Type casting is the process of explicitly converting a value of one data type to another, such as converting an integer to a float.
Question 45 of 50
What is the modulo operator (%) in programming?
Correct answer: C) Evaluates the remainder of division
Explanation: The modulo operator (%) returns the remainder of a division between two integers.
Question 46 of 50
What is the result of any odd number % 2?
Correct answer: B) 1
Explanation: Any odd number divided by 2 will have a remainder of 1, so the result of odd number % 2 is always 1.
Question 47 of 50
What is an array data type?
Correct answer: B) A collection of ordered elements of a given data type
Explanation: An array is a collection of elements of the same data type, stored in contiguous memory locations, and accessed using an index.
Question 48 of 50
What is a constant in programming?
Correct answer: B) A named value that cannot change
Explanation: A constant is a value that cannot change during program execution, often used to store fixed values like Pi.
Question 49 of 50
What is an index in an array?
Correct answer: C) The location number of an element
Explanation: An index represents the position of an element in an array, starting from 0.
Question 50 of 50
What is a scalar variable?
Correct answer: A) A single-item (non-array) variable
Explanation: A scalar variable is a single variable that holds one value, as opposed to an array or complex data structure.
Set 1 complete
You scored 0%
0 correct out of 0 answered (50 questions in this set).