wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Compro. Final 1/64 part1

Total questions: 25

Worksheet time: 1hrs 27mins

Name
Class
Date
1.

A pointer is

a)

a variable that stores an address

b)

one of the C keywords

c)

a pre-processor directive

d)

a C string

e)

Skip

2.

What is the correct explanation of this C code “int *ptr[20]”.

a)

An array of 20 pointers to int

b)

A pointer to an array of 20 ints

c)

20 int pointers to an array

d)

20 arrays of a pointer to int

e)

Skip

3.

Choose an invalid C code

a)

int *A = NULL;

b)

int *A[20][20];

c)

int *A[20] = NULL;

d)

int (*A)[20] = NULL

e)

skip

4.

What will be printed on screen from the following C code?

a)

140 140

b)

2 140

c)

100 140

d)

140 100

e)

skip

5.

What will be printed on screen from the following C code?

a)

140 140

b)

2 140

c)

100 140

d)

140 100

e)

skip

6.

What will be printed on screen from the following C code?

a)

140 140

b)

2 140

c)

100 140

d)

140 100

7.

What will be printed on screen from the following C code?

a)

140 140

b)

2 140

c)

100 140

d)

140 100

e)

skip

8.

What is the result of line number 13?

a)

16.00

b)

26.00

c)

31.00

d)

10.50

e)

skip

9.

What is the result of line number 13?

a)

4.00

b)

8.00

c)

16.00

d)

20.00

e)

skip

10.

What is the result of line number 12?

a)

5

b)

10

c)

15

d)

25

e)

skip

11.

What will be the output of the following C code?

a)

Welcome to my function

b)

0

c)

Welcome to my function 0

d)

Compile error

e)

skip

12.

What will be the output of the following C code?

a)

function1function1

b)

10

c)

Hello!Hello!

d)

Compile Error

e)

skip

13.

What will be the output of the following C code?

a)

0 1 2

b)

0 2 4

c)

0 3 5

d)

0 5 10

e)

skip

14.

What are the correct output of out1 and out2 for this code?

a)

out1 = 10, out2 = 75

b)

out1 = 7, out2 = 13

c)

out1 = 1, out2 = 1

d)

out1 = 0, out2 = 0

e)

skip

15.

What are the correct output of out1 and out2 for this code?

a)

out1 = 0, out2 = 2

b)

out1 = 2, out2 = 4

c)

out1 = 4, out2 = 8

d)

out1 = 0, out2 = 0

e)

skip

16.

Which choice is correct about function topic?

a)

Main function is a user-defined function.

b)

Return value is the most important thing for user-defined function.

c)

Function declaration is not necessary, in case of user-defined function is above main function.

d)

User-defined function is the main function.

e)

skip

17.

What will be the output of the following C code?

a)

Result is 0

b)

Result is 4

c)

Result is 0, 4

d)

Result is 4, 0

e)

skip

18.

Which is possible for function declaration for line 3?

a)

int average(int arr[]);

b)

void average(float arr[]);

c)

float average(int arr[]);

d)

int average(void);

e)

skip

19.

What is the result of line 12?

a)

5, 5

b)

5, 10

c)

5, 6

d)

5, 0

e)

skip

20.

What will be the output of the following C code?

a)

m = 5, n = 1

b)

m = 1, n = 5

c)

m = x, n = y

d)

Compile error

e)

skip

21.

Which of the following file modes opens a file in the write state for updating?

a)

ab

b)

rb

c)

r+b

d)

wb

e)

skip

22.

What is in the file SAMPLE.DAT after running the program?

a)

Nothing

b)

12345

c)

ABCDE

d)

Error to run

e)

skp

23.

Which of the following statements about files is true?

a)

All files must be opened before they can be used.

b)

Binary files are more portable than text files.

c)

Binary files are slower than text files.

d)

Files must be closed.

e)

skip

24.

Choose an incorrect statement about C file operation program?

a)

FOPEN opens a file named readme.txt in Read Mode.

b)

EOF is End Of File. ch==EOF checks for end of file and while loop stops or exits.

c)

FGETC(fp) is a function that returns one character and cursor goes to next character.

d)

EOF is a new line checking.

e)

skip

25.

If a FILE pointer is NULL what does it mean?

a)

Unable to open a file named abc.txt

b)

abc.txt is not available on disk

c)

Hard disk has hardware problems.

d)

All the above

e)

skip