wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

compprog reviewer

Total questions: 60

Worksheet time: 30mins

Name
Class
Date
1.

If a C compiler is developed for a specific Operating System, why might it not work on a different operating system?

a)

due to syntax differences in the source code

b)

due to incompatible header files between systems

c)

due to different machine code translations targeting specific system architectures

d)

due to semantic variations in programming topic

2.

in program development, what is the main objective of the testing phase?

a)

making the software available for users

b)

designing the structure of the software

c)

ensuring the software works as intended and fixing bugs

d)

writing the code for the software

3.

which of the following programming language is known for its simplicity and English-like syntax, making it great for beginners?

a)

Assembly

b)

Python

c)

Java

d)

C

4.

which of the following is an example of an embedded system?

a)

mobile apps

b)

websites and web apps

c)

pc games

d)

software in car engines

5.

what is the primary purpose of software development tools?

a)

to perform special tasks needed for computers' operation and maintenance

b)

to provide to a user interface for interacting with the computer

c)

to control and manage the basic operations of a computer

d)

to help programmers build applications

6.

in a computer, what is the role of the random access memory (ram)?

a)

permanent data storage

b)

processing instructions

c)

managing input/output devices

d)

temporary data storage for quicker access

7.

in a library system, what could be a potential input for a function to borrow a book?

a)

the date of borrowing

b)

the member's ID and the book's ID

c)

the title of a book

d)

the return date of the book

8.

what type of software is responsible for managing the hardware and other programs in a computer?

a)

application software

b)

software development tools

c)

operating system

d)

utility programs

9.

in system development life cycle (sclc), what is the primary focus of the analysis phase?

a)

writing the code for the software

b)

testing the software for bugs

c)

determining what the software should do based on collected requirements

d)

making the software available for users

10.

which of the following is a characteristic of high-level programming languages like python and java?

a)

they are specifically designed for performing arithmetic operations

b)

they are executed directly by the computer's hardware without the need for translation

c)

they are easier for humans to read and understand compared to low-level languages

d)

they are written in binary code

11.

in c, which of the following is used to handle new lines in strings?

a)

\n

b)

\newline

c)

\return

d)

\enter

12.

which early computer was specifically designed to decipher encrypted messages during world war ii?

a)

colossus

b)

atanasoff-berry computer

c)

analytical engine

d)

eniac

13.

what is the primary reason for the development of high-level programming languages?

a)

to reduce the cost of software development

b)

to make programming easier and more accessible for people

c)

to eliminate the need for hardware

d)

to increase the processing speed of the computers

14.

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?

a)

comment

b)

compiler

c)

header files

d)

main function

15.

which of the following is an example of system software?

a)

web browser

b)

word processor

c)

spreadsheet application

d)

operating system

16.

which of the following is NOT a characteristic of an algorithm?

a)

it takes an input, processes it, and produces the desired output

b)

it is a procedure or set of steps used to accomplish a task

c)

it is a set of instructions that solves a problem

d)

it is written in a specific programming language

17.

which of the following individuals is known for writing the world's first computer program?

a)

ada lovelace

b)

john atanasoff

c)

charles babbage

d)

john mauchly

18.

which modeling tools is used to visually represent the flow of a process in program development

a)

assembly language

b)

algorithm

c)

pseudocode

d)

flowchart

19.

which phase of the system development life cycle (sdlc) involves fixing any new bugs, making updates, and ensuring the software remains secure and effective

a)

deployment phase

b)

development phase

c)

testing phase

d)

maintenance phase

20.

what is the primary distinction between syntax and semantics in programming?

a)

syntax refers to the logic of the program while semantics refers to the rules of writing code

b)

syntax and semantics refer to the same aspect of programming logic

c)

syntax refers to the rules of writing code while semantic refers to the meaning or logic of the program

d)

syntax refers to the style of coding while semantics refers to the efficiency of code execution

21.

which of the following is a real-world application of computer programming?

a)

hardware design

b)

network configuration

c)

data analysis and artificial intelligence

d)

operating system installation

22.

what is the main difference between system software and application software?

a)

system software cannot be seen or touched, while application software has physical form.

b)

system software manages basic computer operations, while application software is used to perform specific tasks

c)

system software is installed by the user, while application software comes pre-installed on a computer

d)

system software is used for programming, while application software is not used for programming

23.

which of the following best describes the role of header files in the C programming language?

a)

they are used to comment and explain code

b)

they contain declarations of functions and variables that can be used in the program

c)

they are used to directly manipulate hardware resources

d)

they define the main function where program execution begins

24.

which early computer was designed to calculate artillery firing tables for the US Army?

a)

colossus

b)

analytical engine

c)

eniac

d)

atanasoff-berry computer

25.

which of the following is not a characteristic of high-level languages as compared to low-level languages in the context of C?

a)

more abstraction from machine code

b)

closer resemblance to human language

c)

easier readability and understanding

d)

direct manipulation of hardware resources

26.

what type of software would a virus scanner be classified as?

a)

software development tool

b)

utility program

c)

system software

d)

application software

27.

in computer programming, what does an algorithm represent?

a)

a type of hardware component

b)

a type of software

c)

a programming language

d)

a set of instructions to solve a problem

28.

what is the primary function of a complier in programming?

a)

to translate source code into machine code

b)

to execute programs directly

c)

to debug programs for errors

d)

to create graphical user interfaces

29.

in C programming, which of the following is a correct way to include the Standard input/output header file

a)

#include "stdio.h"

b)

import <stdio.h>

c)

import "stdio.h"

d)

#include <stdio.h>

30.

which of the following is an example of an input/output (i/o) device?

a)

hard drive

b)

ram

c)

cpu

d)

keyboard

31.

Which of the following is a valid identifier in C?

a)

  name@

b)

  _name

c)

  2names

d)

  name#

32.

What is the role of a semicolon (;) in C?

a)

  To indicate a loop 

b)

 To terminate statements 

c)

To denote comments

d)

  To separate variables 

33.

Which of the following is a keyword in C?

a)

main

b)

printf

c)

printf

d)

if

34.

What does the ‘&&’ operator do in C?

a)

None of the above

b)

Bitwise AND

c)

Logical AND

d)

Both bitwise and logical

35.

Which of the following is true about C identifiers?

a)

They can start with a digit

b)

They are case-sensitive

c)

They can contain spaces

d)

 All of the choices

36.

Which of the following is a logical operator in C?&&

a)

!

b)

&&

c)

||

d)

All of the choices

37.

Which operator is used to check equality in C?

a)

===

b)

!=

c)

=

d)

==

38.

What is the result of the expression 5 % 2 in C?

a)

1

b)

2.5

c)

2

d)

0

39.

What does the || operator do in C?

a)

Logical OR

b)

Adds two values

c)

Multiplies two values

d)

Bitwise OR

40.

Which operator is used for bitwise XOR in C?

a)

&

b)

^

c)

%

d)

|

41.

Which of the following is a ternary operator in C?

a)

None of the choices

b)

&&

c)

||

d)

?:

42.

What is the result of 5 && 3 in C?

a)

0

b)

3

c)

5

d)

1

43.

What is the output of printf("%d", 5 | 3 & 2); in C, considering operator precedence?

a)

2

b)

5

c)

3

d)

7

44.

In C, what is the output of int a = 5; printf("%d", a+++a);?

a)

10

b)

12

c)

11

d)

Syntax error

45.

If a is an integer variable, what will be the value that a = 5/2 will return?

a)

0

b)

2.5

c)

3

d)

2

46.

If x is a float variable, what will be the value that x = 5/2 will return?

a)

2

b)

2.5

c)

3

d)

0

47.

Which of the following is the correct way to declare a string in C?

a)

char greet[] = "Happy New Year!";

b)

 string[] greet = {'H', 'a', 'p', 'p', 'y', ' ', 'N', 'e', 'w', ' ', 'Y', 'e', 'a', 'r', '!'};

c)

char[] greet = {'H', 'a', 'p', 'p', 'y', ' ', 'N', 'e', 'w', ' ', 'Y', 'e', 'a', 'r', '!'};

d)

string greet[] = {"Happy New Year!"};

48.

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)

 }

a)

55

b)

40

c)

None of the choices

d)

65

49.

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;

    }

a)

55

b)

600

c)

40

d)

None of the choices

50.

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;

 }


a)

1

b)

0

c)

False

d)

True

51.

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;

    }

a)

0

b)

Syntax Error

c)

1

d)

True

52.

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);

    }

a)

0

b)

Syntax Error

c)

False

d)

1

53.

What is the correct way to write a conditional statement to check if ‘a’ is equal to 10?

a)

if a = 10

b)

if (a == 10)

c)

if a == 10

d)

if (a = 10)

54.

In a 'switch' statement, what is the purpose of 'break'?

a)

To break the switch into parts

b)

None of the above

c)

To exit the current case

d)

To stop the program

55.

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");

a)

AB

b)

A

c)

 No output

d)

B

56.

What is the default case in a switch statement used for?

a)

To repeat the switch

b)

To end the switch statement

c)

To catch any case not specifically handled

d)

To handle errors

57.

What happens if a break statement is not used in a switch case?

a)

The switch statement ends immediately

b)

The next case will execute (fall-through)

c)

 It results in a compile-time error

d)

The program will crash

58.

What is the result of using a logical AND (&&) operator in an if statement?

a)

Executes if both conditions are false

b)

Executes if either of the conditions is true

c)

Executes if at least one condition is false

d)

Executes if both conditions are true

59.

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?

a)

 if (x > 10) && (x < 2)

b)

if (x > 10) || (x < 2)

c)

 if (x > 10 && x < 2)

d)

if (x > 10 || x < 2)

60.

An application checks if the user is logged in and has admin rights to access a page. Which condition correctly implements this check?

a)

if (!isLoggedIn && !isAdmin)

b)

if (isLoggedIn && isAdmin)

c)

if (isLoggedIn && !isAdmin)

d)

 if (isLoggedIn || isAdmin)