wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C programming

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

Who is the father of C language?

a)

Steve Jobs

b)

James Gosling

c)

Dennis Ritchie

d)

Rasmus Lerdorf

2.

All keywords in C are in ____________?

a)

LowerCase letters

b)

UpperCase letters

c)

CamelCase letters

d)

None of the mentioned

3.

What is #include <stdio.h>?

a)

Preprocessor directive

b)

Inclusion directive

c)

File inclusion directive

d)

None of the mentioned

4.

Which character is used to indicate the end of a statement in C?

a)

:

b)

.

c)

;

d)

,

5.

Which symbol is used for the 'modulo' operation in C?

a)

%

b)

*

c)

/

d)

^

6.

What data type would you use to store a character in C?

a)

char

b)

int

c)

float

d)

double

7.

What is the purpose of the printf function in C?

a)

To read input

b)

To print output

c)

To perform calculations

d)

To control program flow

8.

What does %d signify in the printf or scanf function?

a)

Decimal integer

b)

Double data type

c)

Dynamic allocation

d)

Directory path

9.

What does the '==' operator check?

a)

Assignment

b)

Equality

c)

Greater than

d)

Less than

10.


What does the break statement do in a loop?

a)

Exits the loop

b)

Skips the current iteration

c)

Repeats the loop

d)


Does nothing

11.

What is the default return type of a function in C if no return type is specified?

a)

void

b)

char

c)

float

d)

int

12.

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

a)

int &ptr;

b)

ptr int;

c)

int ptr*;

d)

int *ptr;

13.

What does the sizeof operator do in C?

a)

Both a and b

b)

Returns the size of a variable

c)

Returns the size of a data type

d)

Returns the total memory used by the program