wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming skill

Total questions: 26

Worksheet time: 14mins

Name
Class
Date
1.

1. What is the dimension of the below C array?

int a[3][3][2]

a)

2

b)

3

c)

5

d)

none of the above

2.

During the initialization of 2D array if the values are missing they are automatically set to

a)

0

b)

NULL

c)

1

d)

None of the above

3.

Which of the following is correct method of initialization?

a)

int arr[2][3] = {{0,0,0},(1,1,1}};

b)

int arr[2][] = {{0,0,0},(1,1,1}};

c)

int arr[2][3] = {{0,0,0,0,0},(1,1,1}};

d)

int arr[2][3] = {};

4.

If the values in the two dimensional arrays as follows: int a[3][3]={10,20,30,40,50,60,70,80,90};

what will be the index of 60?

a)

2,1

b)

2,0

c)

1,2

d)

0,1

5.

During initialization of two-dimensional array an error occurs if the array size of is not written.

a)

First/Row

b)

Second/Column

c)

both option 1 & 2

d)

option 1 or 2

6.

While counting the string length is the terminating null character counted?

a)

yes

b)

no

7.

The parameters which are in the function header is called

a)

Actual

b)

Formal

c)

Global

d)

Local

8.

Which is the correct syntax for writing function header?

a)

int mul(int a, int b)

b)

int mul(int a, int b);

c)

int mul(int , int)

d)

int mul(int a, b);

9.

When a function is called

a)

Formal parameter is copied into actual parameter

b)

Actual parameter is copied into formal parameter

c)

Both the above two options are possible

d)

Global is copied to formal parameter

10.

When the return is encountered the control is passed

a)

Only to the main function

b)

To the called function

c)

To the calling function

d)

Control remains in the same function

11.

If the return type of the function is not specified the default will be

a)

Char

b)

Void

c)

Float

d)

Int

12.

In what condition we can exclude the return statement in function?

a)

When function has return type void

b)

When the return type is not specified

c)

When function has return type int

d)

None of the above

13.

When we place function prototype above all the functions is called as

a)

Local Prototype

b)

Global Prototype

c)

Static prototype

d)

None of the above

14.

When we place function prototype inside the function definition is called as

a)

Local prototype

b)

Global prototype

c)

Static prototype

d)

None of the above

15.

Actual parameters are written into

a)

Function header

b)

Function defination

c)

Function call

d)

Function declaration

16.

Function that is called by itself is called

a)

Super function

b)

Recursive function

c)

Main function

d)

All of them

17.
a)

10

b)

5

c)

15

d)

Compile time error

18.

Which operator is connecting the structure variable to structure member?

a)

Dot operator

b)

Member operator

c)

Period operator

d)

All of the above

19.

Which operator is connecting the structure variable to structure member?

a)

.

b)

->

c)

:

d)

@

20.

What will be the correct for union?

a)

All the members can be initialized in union

b)

All the members share same location in memory

c)

All the members have its own storage

d)

All the members of union can be access any time

21.
a)

2

b)

20

c)

4

d)

26

22.

Size of the union is determined by size of the

a)

First member in the union

b)

Last member in the union

c)

Biggest member in the union

d)

Sum of the size of all member

23.
a)

0

b)

Garbage value

c)

Compile time error

d)

25

24.

a)

2

b)

5

c)

8

d)

15

25.

a)

struct book b1= {“BASIC”,”BALAGURUSAMI”,300,240.67};

b)

struct book b1= {“BASIC”,”BALAGURUSAMI”,300,240};

c)

struct book b1= {“BASIC”,”BALAGURUSAMI”};

d)

struct book b1= {“BASIC”,300,240.67};

26.

Which is the correct syntax to use typedef for structure?

a)
b)
c)
d)

All of the above