wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C Language Data Types

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What are the basic data types in C language?

a)

int, char, float, double, void

b)

long

c)

string

d)

bool

e)

short

2.

What is the purpose of the sizeof operator in C?

a)

To control program flow

b)

To check for memory leaks

c)

To convert data types

d)

To determine the size of a variable or data type in bytes.

3.

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

a)

16 bytes

b)

8 bytes

c)

2 bytes

d)

4 bytes

4.

How is the size of a data type determined using the sizeof operator?

a)

The size of a data type is determined by the number of bits it occupies in memory

b)

The size of a data type is determined by the data type itself

c)

The size of a data type is determined by counting the number of characters it contains

d)

The size of a data type is determined by using the sizeof operator to calculate the number of bytes it occupies in memory.

5.

What is the size of 'char' data type in C language?

a)

1 byte

b)

8 bytes

c)

4 bytes

d)

2 bytes

6.

Explain the difference between 'int' and 'float' data types in C.

a)

Both 'int' and 'float' are used for integers in C.

b)

'int' and 'float' are interchangeable data types in C.

c)

In C, 'int' is for floating-point numbers, while 'float' is for integers.

d)

In C, 'int' is for integers, while 'float' is for floating-point numbers.

7.

How is the size of a structure calculated in C using the sizeof operator?

a)

sizeof(structure)

b)

sizeof(structure)

c)

sizeof(structure_name)

d)

sizeof(structure_name)

8.

What is the size of 'double' data type in C language?

a)

12 bytes

b)

16 bytes

c)

8 bytes

d)

4 bytes

9.

Why is it important to understand data types in C programming?

a)

It is important to understand data types in C programming to ensure proper memory allocation, manipulation, and interpretation of data.

b)

Manipulation of data in C programming does not require knowledge of data types

c)

Data types in C programming have no impact on memory allocation

d)

Understanding data types in C programming is not important

10.

What is the significance of the 'long' keyword in C data types?

a)

It is used to declare constant variables.

b)

It is used to specify variables that can hold smaller values than 'int'.

c)

It is used to specify variables that can hold larger values than 'int'.

d)

It is used to define floating-point variables.