wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C Programming Quiz

Total questions: 19

Worksheet time: 10mins

Name
Class
Date
1.

Who developed the C programming language?

a)

James Gosling

b)

Dennis M Ritchie

c)

Bjarne Stroustrup

d)

Ken Thompson

2.

In which year was the C programming language first introduced?

a)

1990

b)

1980

c)

1972

d)

1967

3.

What is the main function in a C program?

a)

The function that handles input

b)

The function that outputs results

c)

The function where execution starts

d)

The function that performs calculations

4.

Which of the following is a valid identifier in C?

a)

float

b)

variable-name

c)

1stVariable

d)

_variable

5.

What does the 'printf' function do in C?

a)

Reads user input

b)

Prints formatted output

c)

Declares variables

d)

Defines functions

6.

Which of the following is NOT a basic data type in C?

a)

char

b)

string

c)

float

d)

int

7.

What is the size of an 'int' data type in C?

a)

4 bytes

b)

2 or 4 bytes

c)

1 byte

d)

8 bytes

8.

Which of the following is a keyword in C?

a)

function

b)

if

c)

variable

d)

array

9.

What is the purpose of the 'scanf' function?

a)

To define functions

b)

To declare variables

c)

To read user input

d)

To print output to the console

10.

What is a constant in C?

a)

A variable that can change

b)

A fixed value that does not change

c)

A function that returns a value

d)

A data type

11.

Which of the following is an example of a real constant?

a)

0

b)

'A'

c)

3.14

d)

10

12.

What is the output of the following code: printf("%d", 5);?

a)

None of the above

b)

5

c)

5.0

d)

Error

13.

What is the purpose of the body of a C program?

a)

To perform tasks and operations

b)

To declare functions

c)

To include libraries

d)

To execute the main function

14.

Which of the following is a feature of C programming?

a)

Declarative

b)

Functional

c)

Procedural

d)

Object-oriented

15.

What does the term 'portable' mean in the context of C programming?

a)

Code is secure

b)

Code is easy to write

c)

Code can be transferred between machines

d)

Code can be easily read

16.

What is the role of header files in C?

a)

To execute the program

b)

To define variables

c)

To include standard libraries

d)

To store constants

17.

Which of the following is a valid declaration of a variable in C?

a)

int 1a;

b)

double a=5;

c)

float a;

d)

char a@;

18.

What is the purpose of decision-making statements in C?

a)

To declare variables

b)

To print output

c)

To perform calculations

d)

To execute code based on conditions

19.

Which of the following is correct?

a)

(a<9 && b<8)

b)

(a<8) && (b<7)

c)

(a>9 & b<9)

d)

None of these