NEW
Font size
Worksheetscompprog reviewer
Total questions: 60
Worksheet time: 30mins
If a C compiler is developed for a specific Operating System, why might it not work on a different operating system?
due to syntax differences in the source code
due to incompatible header files between systems
due to different machine code translations targeting specific system architectures
due to semantic variations in programming topic
in program development, what is the main objective of the testing phase?
making the software available for users
designing the structure of the software
ensuring the software works as intended and fixing bugs
writing the code for the software
which of the following programming language is known for its simplicity and English-like syntax, making it great for beginners?
Assembly
Python
Java
C
which of the following is an example of an embedded system?
mobile apps
websites and web apps
pc games
software in car engines
what is the primary purpose of software development tools?
to perform special tasks needed for computers' operation and maintenance
to provide to a user interface for interacting with the computer
to control and manage the basic operations of a computer
to help programmers build applications
in a computer, what is the role of the random access memory (ram)?
permanent data storage
processing instructions
managing input/output devices
temporary data storage for quicker access
in a library system, what could be a potential input for a function to borrow a book?
the date of borrowing
the member's ID and the book's ID
the title of a book
the return date of the book
what type of software is responsible for managing the hardware and other programs in a computer?
application software
software development tools
operating system
utility programs
in system development life cycle (sclc), what is the primary focus of the analysis phase?
writing the code for the software
testing the software for bugs
determining what the software should do based on collected requirements
making the software available for users
which of the following is a characteristic of high-level programming languages like python and java?
they are specifically designed for performing arithmetic operations
they are executed directly by the computer's hardware without the need for translation
they are easier for humans to read and understand compared to low-level languages
they are written in binary code
in c, which of the following is used to handle new lines in strings?
\n
\newline
\return
\enter
which early computer was specifically designed to decipher encrypted messages during world war ii?
colossus
atanasoff-berry computer
analytical engine
eniac
what is the primary reason for the development of high-level programming languages?
to reduce the cost of software development
to make programming easier and more accessible for people
to eliminate the need for hardware
to increase the processing speed of the computers
which of the following is included at the beginning of a C program to declare function and variables that can be used in the program?
comment
compiler
header files
main function
which of the following is an example of system software?
web browser
word processor
spreadsheet application
operating system
which of the following is NOT a characteristic of an algorithm?
it takes an input, processes it, and produces the desired output
it is a procedure or set of steps used to accomplish a task
it is a set of instructions that solves a problem
it is written in a specific programming language
which of the following individuals is known for writing the world's first computer program?
ada lovelace
john atanasoff
charles babbage
john mauchly
which modeling tools is used to visually represent the flow of a process in program development
assembly language
algorithm
pseudocode
flowchart
which phase of the system development life cycle (sdlc) involves fixing any new bugs, making updates, and ensuring the software remains secure and effective
deployment phase
development phase
testing phase
maintenance phase
what is the primary distinction between syntax and semantics in programming?
syntax refers to the logic of the program while semantics refers to the rules of writing code
syntax and semantics refer to the same aspect of programming logic
syntax refers to the rules of writing code while semantic refers to the meaning or logic of the program
syntax refers to the style of coding while semantics refers to the efficiency of code execution
which of the following is a real-world application of computer programming?
hardware design
network configuration
data analysis and artificial intelligence
operating system installation
what is the main difference between system software and application software?
system software cannot be seen or touched, while application software has physical form.
system software manages basic computer operations, while application software is used to perform specific tasks
system software is installed by the user, while application software comes pre-installed on a computer
system software is used for programming, while application software is not used for programming
which of the following best describes the role of header files in the C programming language?
they are used to comment and explain code
they contain declarations of functions and variables that can be used in the program
they are used to directly manipulate hardware resources
they define the main function where program execution begins
which early computer was designed to calculate artillery firing tables for the US Army?
colossus
analytical engine
eniac
atanasoff-berry computer
which of the following is not a characteristic of high-level languages as compared to low-level languages in the context of C?
more abstraction from machine code
closer resemblance to human language
easier readability and understanding
direct manipulation of hardware resources
what type of software would a virus scanner be classified as?
software development tool
utility program
system software
application software
in computer programming, what does an algorithm represent?
a type of hardware component
a type of software
a programming language
a set of instructions to solve a problem
what is the primary function of a complier in programming?
to translate source code into machine code
to execute programs directly
to debug programs for errors
to create graphical user interfaces
in C programming, which of the following is a correct way to include the Standard input/output header file
#include "stdio.h"
import <stdio.h>
import "stdio.h"
#include <stdio.h>
which of the following is an example of an input/output (i/o) device?
hard drive
ram
cpu
keyboard
Which of the following is a valid identifier in C?
name@
_name
2names
name#
What is the role of a semicolon (;) in C?
To indicate a loop
To terminate statements
To denote comments
To separate variables
Which of the following is a keyword in C?
main
printf
printf
if
What does the ‘&&’ operator do in C?
None of the above
Bitwise AND
Logical AND
Both bitwise and logical
Which of the following is true about C identifiers?
They can start with a digit
They are case-sensitive
They can contain spaces
All of the choices
Which of the following is a logical operator in C?&&
!
&&
||
All of the choices
Which operator is used to check equality in C?
===
!=
=
==
What is the result of the expression 5 % 2 in C?
1
2.5
2
0
What does the || operator do in C?
Logical OR
Adds two values
Multiplies two values
Bitwise OR
Which operator is used for bitwise XOR in C?
&
^
%
|
Which of the following is a ternary operator in C?
None of the choices
&&
||
?:
What is the result of 5 && 3 in C?
0
3
5
1
What is the output of printf("%d", 5 | 3 & 2); in C, considering operator precedence?
2
5
3
7
In C, what is the output of int a = 5; printf("%d", a+++a);?
10
12
11
Syntax error
If a is an integer variable, what will be the value that a = 5/2 will return?
0
2.5
3
2
If x is a float variable, what will be the value that x = 5/2 will return?
2
2.5
3
0
Which of the following is the correct way to declare a string in C?
char greet[] = "Happy New Year!";
string[] greet = {'H', 'a', 'p', 'p', 'y', ' ', 'N', 'e', 'w', ' ', 'Y', 'e', 'a', 'r', '!'};
char[] greet = {'H', 'a', 'p', 'p', 'y', ' ', 'N', 'e', 'w', ' ', 'Y', 'e', 'a', 'r', '!'};
string greet[] = {"Happy New Year!"};
Given the code below, what will be the printed output?
int main() {
int x = 25;
int y = 15;
int z = x + y;
printf("%d", z += y)
}
55
40
None of the choices
65
Given the code below, what will be the printed output?
int main() {
int x = 25;
int y = 15;
int z = x + y;
printf("%d", z *= y);
return 0;
}
55
600
40
None of the choices
Given the code below, what will be the printed output?
int main() {
int a = 32, b = 64, c = a+b;
printf("%d", a >= b);
return 0;
}
1
0
False
True
Given the code below, what will be the printed output?
int main() {
int a = 32, b = 64, c = b/a;
printf("%d", a >= c);
return 0;
}
0
Syntax Error
1
True
Given the code below, what will be the printed output?
int main() {
int a = 15, b = 5, c = 10, result;
result = (a == b) && !(c > b);
printf("%d", result);
}
0
Syntax Error
False
1
What is the correct way to write a conditional statement to check if ‘a’ is equal to 10?
if a = 10
if (a == 10)
if a == 10
if (a = 10)
In a 'switch' statement, what is the purpose of 'break'?
To break the switch into parts
None of the above
To exit the current case
To stop the program
What will be the output of the following code?
int a = 10, b = 20;
if (a > b)
printf("A");
else if (a == b)
printf("AB");
else
printf("B");
AB
A
No output
B
What is the default case in a switch statement used for?
To repeat the switch
To end the switch statement
To catch any case not specifically handled
To handle errors
What happens if a break statement is not used in a switch case?
The switch statement ends immediately
The next case will execute (fall-through)
It results in a compile-time error
The program will crash
What is the result of using a logical AND (&&) operator in an if statement?
Executes if both conditions are false
Executes if either of the conditions is true
Executes if at least one condition is false
Executes if both conditions are true
In a program, you want to check if a number x is either greater than 10 or less than 2. Which of the following conditions is correct?
if (x > 10) && (x < 2)
if (x > 10) || (x < 2)
if (x > 10 && x < 2)
if (x > 10 || x < 2)
An application checks if the user is logged in and has admin rights to access a page. Which condition correctly implements this check?
if (!isLoggedIn && !isAdmin)
if (isLoggedIn && isAdmin)
if (isLoggedIn && !isAdmin)
if (isLoggedIn || isAdmin)
