wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ICT8 Coding Quiz Bee

Total questions: 25

Worksheet time: 14mins

Name
Class
Date
1.

What is the purpose of #include <stdio.h> in a C program?

a)
To include external libraries for advanced graphics.
b)
To define custom data types for the program.
c)
To include the standard input/output library for using input and output functions.
d)
To enable multi-threading capabilities in the program.
2.

What does the printf() function do in C?

a)
The printf() function prints formatted output to the console.
b)
The printf() function executes system commands.
c)
The printf() function stores data in a file.
d)
The printf() function reads input from the user.
3.

int (a)   () printf{ ("Hello World!"); return 0; }

4.

What does the return 0; statement do in the main() function?

a)


It prints the value 0 to the screen

b)

It defines the start of the program

c)

It ends the main() function

d)


It adds a new line in the output

5.

C ignores white space, such as blank lines and extra spaces.

a)

TRUE

b)

FALSE

6.

In C, each code statement must end with a semicolon (;).

a)

TRUE

b)

FALSE

7.

What is the output of the following code? printf("Hello World!")

a)
Hello Universe!
b)

printf

c)

Error

d)
Hello World!
8.

Statements are executed, one by one, in the same order as they are written.

a)

True

b)

False

9.

You cannot use more than one printf() functions in your program.

a)

True

b)

False

10.

What does the \n character do in a C program?

a)
The ' ' character terminates the program execution.
b)
The ' ' character adds a tab space in the output.
c)
The '\n' character creates a new line in the output.
d)
The ' ' character comments out the following line.
11.

What will the following code output?
printf("Hello World!\nI am learning C.");

a)

Hello World! I am learning in C.

b)
Hello World! I am learning C.
c)
Hello World! Learning C is fun.
d)
Hello World! I am programming in C.
12.

How can you create a blank line between two printed lines in C?

a)
Use printf("Line 1 Line 2");
b)
Use printf("Line 1 Line 2");
c)
Use printf("Line 1\n\nLine 2");
d)

Use printf("Line 1\n Line 2");

13.

What is the meaning of comments in C?

a)
Comments in C are mandatory for every line of code.
b)
Comments in C are used to execute code snippets directly.
c)
Comments in C are used to define variables and functions.
d)
Comments in C are non-executable text used for documentation and clarification in the code.
14.

Which data type is used to store integers (whole numbers) in C?

a)
char
b)
float
c)
double
d)
int
15.

What is the correct syntax to declare a variable of type int with the value 15?

a)
int variableName = 15;
b)
int variableName : 15;
c)
int 15 = variableName;
d)
variableName: int = 15;
16.

Create a variable named weight and assign the value 45.23 to it.

(a)  

17.

Why won't the following code run?
int myNum = 15;
printf(myNum);

a)
The printf function is missing a format specifier.
b)
The variable myNum is not declared properly.
c)
The printf function is missing a return type.
d)
The printf function requires a string argument.
18.

What format specifier is used to print an integer value in C?

a)

%c

b)
%d
c)

%f

d)
%i
19.

What will the following code output?
int myNum = 15;
printf("%d", myNum);

a)
15
b)

myNum

c)

%d

d)

An error

20.

Which format specifier is used to print a multiple characters in C?

a)

%c

b)

%d

c)

%i

d)

%s

21.

How would you print a float variable with 4 decimal places in C?

a)
printf("%.4f", floatVariable);
b)

printf("4%f", floatVariable);

c)
printf("%.2f", floatVariable);
d)
printf("%.1f", floatVariable);
22.

What will the following code output?

int x = 5;
int y = 6;
int sum = x + y;
printf("%d", sum);

a)
11
b)

5

c)

6

d)
10
23.

Who developed C language?

a)
Bjarne Stroustrup
b)
Dennis Ritchie
c)
James Gosling
d)
Guido van Rossum
24.

Which symbol represents a PROCESS in a flowchart?

a)
Rectangle
b)
Parallelogram
c)
Oval
d)
Diamond
25.

If a student wants to check “Is the score greater than 75?”, which symbol should be used?

a)
Rectangle
b)
Parallelogram
c)
Oval
d)
Diamond