wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C Programming Quiz 2

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Who developed the C programming language?

a)

James Gosling

b)

Dennis Ritchie

c)

Bjarne Stroustrup

d)

Guido van Rossum

2.

In which year was the C language developed?

a)

1969

b)

1972

c)

1975

d)

1980

3.

Which company first developed the C language?

a)

Microsoft

b)

IBM

c)

Bell Labs

d)

Apple

4.

C was developed as an improvement over which language?

a)

Assembly

b)

B

c)

Java

d)

COBOL

5.

C is often referred to as a:

a)

High-level language

b)

Low-level language

c)

Mid-level language

d)

Scripting language

6.

Which of the following is a primitive data type in C?

a)

char

b)

string

c)

list

d)

tuple

7.

The `int` data type in C is used to store:

a)

Floating-point numbers

b)

Characters

c)

Whole numbers

d)

Strings

8.

What is the size of the `float` data type in C?

a)

1 byte

b)

2 bytes

c)

4 bytes

d)

8 bytes

9.

Which of the following data types can store a single character?

a)

int

b)

char

c)

float

d)

double

10.

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

a)

float

b)

int

c)

double

d)

string

11.

Which data type is used to store large floating-point numbers?

a)

int

b)

float

c)

char

d)

double

12.

The `void` data type is used to:

a)

Define a function with no return type

b)

Store integer values

c)

Return a character

d)

Store floating-point numbers

13.

Which modifier is used to change the size of data types like `int`?

a)

large

b)

long

c)

float

d)

void

14.

In C, a variable is a:

a)

Fixed value

b)

Placeholder for storing values

c)

Data type

d)

Function

15.

What symbol is used to declare a variable in C?

a)

=

b)

;

c)

%

d)

No special symbol

16.

Which of the following is a valid variable name?

a)

123variable

b)

_myVar

c)

int

d)

float&

17.

A variable that can store constant values throughout the program is declared using:

a)

var

b)

let

c)

const

d)

volatile

18.

Which of the following variable names is invalid in C?

a)

var_1

b)

_variable

c)

int

d)

count1

19.

Which of these data types can be used to declare a variable?

a)

`float`, `char`

b)

`loop`, `function`

c)

`sum`, `product`

d)

`digit`, `double`

20.

Which of the following is the assignment operator in C?

a)

==

b)

=

c)

:=

d)

-->

21.

The `&&` operator in C is used for:

a)

Bitwise operations

b)

Logical AND

c)

Logical OR

d)

Assignment

22.

Which operator is used to add two values in C?

a)

-

b)

*

c)

+

d)

/

23.

Which of the following is the modulus operator in C?

a)

%

b)

/

c)

&

d)

$

24.

What does the `++` operator do to a variable?

a)

Multiplies the value by 2

b)

Divides the value by 2

c)

Increases the value by 1

d)

Decreases the value by 1

25.

The `!=` operator is used to check if:

a)

Two values are equal

b)

Two values are not equal

c)

A value is negative

d)

A value is positive

26.

Which operator is used to compare two values in C?

a)

==

b)

=

c)

&

d)

&&

27.

Which operator is used to find the quotient in a division operation?

a)

*

b)

/

c)

%

d)

-

28.

What is the result of the expression `5 % 2` in C?

a)

2

b)

0

c)

1

d)

5

29.

What is the precedence of the `+` and `*` operators in C?

a)

+ has higher precedence than *

b)

* has higher precedence than +

c)

Both have the same precedence

d)

Precedence is undefined

30.

Which of these is not a logical operator in C?

a)

&&

b)

||

c)

!

d)

%