wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

pointers and structures

Total questions: 10

Worksheet time: 9mins

Name
Class
Date
1.

What is the output of following program?

a)

20

b)

30

c)

Compile Error

d)

Runtime Error

2.

Arrays always occupy contiguous memory area

a)

True

b)

False

3.

Which of the following format specifier in printf is used to print pointers?

a)

%c

b)

%d

c)

%f

d)

%p

4.

A pointer is

a)

A keyword used to create variables

b)

A variable that stores address of an instruction

c)

A variable that stores address of a varaibe

d)

All of the above

5.

What is the & in pointers?

a)

Dereferences the memory address into an object

b)

References an object into a memory address

c)

Makes a new copy of the object as a memory address

d)

None of the above.

6.

How do you make a pointer point to an existing variable?

int y = 0;

a)

int *x = y;

b)

int x = y;

c)

int *x = &y;

d)

int &x = *y;

7.

#include <stdio.h> double i; int main() { printf("%g\n",i); return 0; }

a)

0

b)

0.000000

c)

Garbage value

d)

Depends on the compiler

8.

User-defined data type can be derived by___________

a)

struct

b)

enum

c)

typedef

d)

all of the mentioned

9.

Which operator connects the structure name to its member name?

a)

b)

<-

c)

.

d)

Both <- and .

10.

Which of the following cannot be a structure member?

a)

Another structure

b)

Function

c)

Array

d)

None of the mentioned