Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C Data Type Conversion Quiz

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is type conversion in C?

a)

Converting one data type to another type

b)

Creating new data types

c)

Ignoring data types

d)

Deleting data types

2.

What are the two types of conversion in C?

a)

Implicit Conversion and Explicit Conversion

b)

Fast Conversion and Slow Conversion

c)

Basic Conversion and Advanced Conversion

d)

Automatic Conversion and Manual Conversion

3.

What is implicit conversion in C?

a)

Automatically done by the compiler

b)

Manually done by the programmer

c)

Not possible in C

d)

Requires external libraries

4.

What is explicit conversion in C?

a)

Not supported in C

b)

Requires special keywords

c)

Automatically done by the compiler

d)

Manually done by placing the type in parentheses

5.

Why is explicit conversion important in C?

a)

To avoid unexpected results

b)

To complicate the code

c)

To speed up the program

d)

To confuse other programmers

6.

What happens when you divide two integers in C without type conversion?

a)

The program crashes

b)

The result is truncated to an integer

c)

The result is rounded to the nearest integer

d)

The result is converted to a float automatically

7.

How can you convert an int value to a float in C?

a)

By adding a decimal point

b)

By placing (float) in front of the value

c)

By using a special function

d)

By changing the data type directly

8.

What is the purpose of type conversion in C?

a)

To slow down the program

b)

To ensure accurate calculations

c)

To increase memory usage

d)

To confuse the compiler

9.

In a real-life example, what is the purpose of converting userScore to float?

a)

To ensure accurate division

b)

To save memory

c)

To complicate the code

d)

To confuse the user

10.

What is the correct way to ensure the result of 3 / 2 is 1.5 in C?

a)

By changing the data types of 3 and 2

b)

By using (float) in the division

c)

By using (int) in the division

d)

By adding a decimal point to the result