wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C Language Quiz

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

Who developed the C programming language?

a)

Dennis Ritchie

b)

Guido van Rossum

c)

James Gosling

d)

Bjarne Stroustrup

2.

What is the primary purpose of the C language?

a)

Data analysis

b)

Game development

c)

System programming

d)

Web development

3.

Which of the following is a valid header file in C?

a)

string.hh

b)

stdio.h

c)

maths.h

d)

iostream.h

4.

What does the 'main()' function represent in a C program?

a)

A function for input

b)

The entry point of the program

c)

A function for error handling

d)

A function for output

5.

What is the return type of the 'main()' function in C?

a)

void

b)

int

c)

char

d)

float

6.

Which statement is used to print output in C?

a)

echo()

b)

print()

c)

printf()

d)

write()

7.

What symbol is used to terminate a statement in C?

a)

;

b)

.

c)

,

d)

:

8.

What does the return statement in the main function indicate?

a)

The status of program termination

b)

The start of the program

c)

The end of the program

d)

The number of errors

9.

Which of the following is NOT a feature of C?

a)

Object-oriented programming

b)

Portability

c)

Procedural programming

d)

Low-level memory access

10.

What is the purpose of header files in C?

a)

To define the main function

b)

To include function declarations

c)

To manage memory

d)

To store variables

11.

Which of the following is a common application of C?

a)

Web applications

b)

Spreadsheet software

c)

Mobile applications

d)

Operating systems

12.

What is the correct syntax for including a header file?

a)

#include

b)

#include [header.h]

c)

#include header.h

d)

#include {header.h}

13.

What does 'malloc()' function do in C?

a)

Reads input

b)

Allocates memory

c)

Prints output

d)

Frees memory

14.

Which of the following data types is NOT supported in C?

a)

int

b)

char

c)

string

d)

float

15.

What operator is used to access members of a structure in C?

a)

*

b)

.

c)

->

d)

&

16.

What is a string in C?

a)

A special data type

b)

A single character

c)

An array of characters

d)

No one

17.

Which header file is required to use common string functions like strlen() and strcpy()?

a)

stdlib.h

b)

string.h

c)

stdio.h

d)

conio.h 

18.

What is the index of the first element in a C array?

a)

1

b)

0

c)

-1

d)

-2

19.

Which of the following is the correct way to declare an integer array named numbers of size 5?

a)

int numbers[5];

b)

numbers int[5];

c)

array numbers[5];

d)

int array numbers[5];

20.

What is the correct way to declare a float variable named temperature?

a)

var temperature: float;

b)

float temperature;

c)

temperature float;

d)

float variable temperature;

21.

Which of the following is a valid way to comment in C?

a)

// This is a comment

b)

/* This is a comment */

c)

Both of the above

d)

None of the above

22.

What is the purpose of the 'return' statement in a function?

a)

To exit the function

b)

To declare a variable

c)

To print output

d)

To return a value to the caller

23.

Which of the following is the correct syntax for declaring a function that takes two integers as arguments and returns an integer?

a)

function int myFunc(int a, int b);

b)

int myFunc(int a, int b);

c)

void myFunc(int a, int b);

d)

myFunc(int a, int b) int;

24.

In C, function parameters are always passed by __________.

a)

reference

b)

value

c)

value-result

d)

name

25.

What is recursion in the context of C functions?

a)

A function calling another function.

b)

A function calling itself directly or indirectly.

c)

A function that never terminates.

d)

A function that does not take any arguments.