wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

2nd yr week 5 apt,reasoning, c prog

Total questions: 75

Worksheet time: 38mins

Name
Class
Date
1.

What does a pointer store?

a)

Value of a variable

b)

Address of a variable

c)

Data type

d)

Size of memory

2.

Which operator is used to access the value stored at the address held by a pointer?

a)

&

b)

*

c)

#

d)

->

3.

What will be the output? int a = 10; int *p = &a; printf("%d", *p);

a)

Address of a

b)

Garbage value

c)

10

d)

Compilation error

4.

Which of the following correctly declares a pointer to an integer?

a)

int p;

b)

int *p;

c)

*int p;

d)

int &p;

5.

What is a NULL pointer?

a)

Pointer pointing to 0th location

b)

Pointer pointing to garbage value

c)

Pointer not pointing to any valid memory

d)

Pointer pointing to itself

6.

Which header file defines NULL?

a)

stdio.h

b)

stdlib.h

c)

stddef.h

d)

All of the above

7.

What will be the output? int a = 5; int *p = &a; printf("%d", ++(*p));

a)

5

b)

6

c)

Address of a

d)

Error

8.

Which pointer is used to access array elements?

a)

File pointer

b)

Function pointer

c)

Array pointer

d)

All pointers

9.

If int *p;, what does p+1 represent?

a)

Address increased by 1 byte

b)

Address increased by size of int

c)

Value incremented by 1

d)

Compilation error

10.

What will be printed? int arr[3] = {1,2,3}; int *p = arr; printf("%d", *(p+2));

a)

1

b)

2

c)

3

d)

Error

11.

Pointer arithmetic depends on:

a)

Compiler

b)

Data type

c)

Operating system

d)

CPU speed

12.

Which of the following is an invalid pointer declaration?

a)

int *p;

b)

float *fp;

c)

char cp*;

d)

double *dp;

13.

A pointer that points to another pointer is called:

a)

Wild pointer

b)

Dangling pointer

c)

Double pointer

d)

Void pointer

14.

What does void *p represent?

a)

Pointer to void function

b)

Generic pointer

c)

Pointer to integer

d)

Null pointer

15.

What happens if a pointer is used without initialization?

a)

Points to NULL

b)

Points to 0

c)

Causes compile-time error

d)

Points to unpredictable location

16.

Which function is used to allocate memory dynamically?

a)

alloc()

b)

malloc()

c)

memalloc()

d)

assign()

17.

Which header file is required for dynamic memory allocation functions?

a)

stdio.h

b)

memory.h

c)

stdlib.h

d)

string.h

18.

What does malloc() return if memory allocation fails?

a)

0

b)

-1

c)

NULL

d)

Garbage value

19.

Which function allocates memory and initializes it to zero?

a)

malloc()

b)

calloc()

c)

realloc()

d)

free()

20.

What is the correct syntax of malloc()?

a)

malloc(size)

b)

malloc(type)

c)

malloc(sizeof(type))

d)

malloc(type, size)

21.

What will be the output of the following code? int *p = (int *)malloc(sizeof(int)); *p = 20; printf("%d", *p);

a)

20

b)

0

c)

A garbage value

d)

Compilation error

22.

Which function is used to resize allocated memory?

a)

resize()

b)

malloc()

c)

realloc()

d)

calloc()

23.

Which function is used to deallocate memory?

a)

delete()

b)

remove()

c)

free()

d)

clear()

24.

What happens if free() is not used?

a)

Program runs faster

b)

No effect

c)

Memory leak occurs

d)

Compile-time error

25.

After free(p), what should be done?

a)

Use p normally

b)

Set p = NULL

c)

Reallocate automatically

d)

Ignore pointer

26.

A die is thrown once. What is the probability of getting a number greater than 4?

a)

1/61/6

b)

1/31/3

c)

1/21/2

d)

2/32/3

27.

A card is drawn from a standard deck of 52 cards. What is the probability of getting a red card?

a)

1/131/13

b)

1/41/4

c)

1/21/2

d)

3/43/4

28.

Two coins are tossed. What is the probability of getting at least one head?

a)

1/41/4

b)

1/21/2

c)

3/43/4

d)

11

29.

What is the probability of getting a prime number when a die is thrown? (Prime numbers: 2, 3, 5)

a)

1/61/6

b)

1/31/3

c)

1/21/2

d)

2/32/3

30.

A bag contains 5 red and 3 blue balls. One ball is drawn at random. What is the probability it is blue?

a)

3/53/5

b)

3/83/8

c)

5/85/8

d)

1/21/2

31.

What is the probability of getting two heads when two coins are tossed?

a)

1/41/4

b)

1/21/2

c)

3/43/4

d)

11

32.

From a deck of cards, what is the probability of drawing a king?

a)

1/521/52

b)

1/261/26

c)

1/131/13

33.

A number is chosen at random from 1 to 10. What is the probability that it is even?

a)

1/101/10

b)

2/52/5

c)

1/21/2

d)

3/53/5

34.

If the probability of success is 0.65, what is the probability of failure?

a)

0.35

b)

0.65

c)

1.65

d)

0.5

35.

A coin is tossed three times. What is the probability of getting exactly two heads?

a)

1/81/8

b)

3/83/8

c)

1/21/2

d)

3/43/4

36.

A card is drawn at random. What is the probability it is neither a king nor a queen?

a)

11/1311/13

b)

10/1310/13

c)

3/133/13

d)

1/131/13

37.

What is the probability of drawing a non-prime number from numbers 1 to 10?

a)

1/21/2

b)

3/103/10

c)

2/52/5

d)

7/107/10

38.

If P(A) = 2/5, what is P(not A)?

a)

2/52/5

b)

3/53/5

39.

Permutation (Q14–Q25) In how many ways can 5 different books be arranged on a shelf?

a)

25

b)

120

c)

60

d)

20

40.

Permutation (Q14–Q25) How many permutations are possible using all letters of the word “CAT”?

a)

3

b)

6

c)

9

d)

12

41.

Permutation (Q14–Q25) In how many ways can 3 people be selected and arranged from 5 people?

a)

10

b)

20

c)

60

d)

120

42.

Permutation (Q14–Q25) How many 3-digit numbers can be formed using digits 1, 2, 3 without repetition?

a)

3

b)

6

c)

9

d)

27

43.

Permutation (Q14–Q25) In how many ways can the letters of the word “APPLE” be arranged?

a)

120

b)

60

c)

30

d)

20

44.

How many permutations of 4 objects taken 2 at a time are possible?

a)

6

b)

8

c)

12

d)

24

45.

In how many ways can 6 people be seated in a row?

a)

36

b)

120

c)

360

d)

720

46.

How many different numbers can be formed using digits 2, 3, 5 if repetition is allowed (3 digits)?

a)

9

b)

18

c)

27

d)

6

47.

In how many ways can the letters of the word MATH be arranged?

a)

12

b)

16

c)

24

d)

32

48.

How many permutations are possible of 7 objects taken all at a time?

a)

504

b)

720

c)

5040

d)

40320

49.

In how many ways can 4 boys and 3 girls be arranged in a row?

a)

144

b)

504

c)

720

d)

5040

50.

How many ways can the word "LEVEL" be arranged?

a)

120

b)

60

c)

30

d)

20

51.

Choose the correct sentence.

a)

He don't like coffee.

b)

He doesn’t likes coffee.

c)

He doesn’t like coffee.

d)

He not like coffee.

52.

Identify the part of the sentence that has an error: She is one of the best student in the class.

a)

She is one

b)

of the best

c)

student

d)

in the class

53.

Choose the grammatically correct sentence.

a)

Each of the players have arrived.

b)

Each of the players has arrived.

c)

Each player have arrived.

d)

Each players has arrived.

54.

Find the error in the sentence: Neither of the answers are correct.

a)

Neither

b)

of the answers

c)

are

d)

correct

55.

Choose the correct option. A) She is more smarter than her sister. B) She is smarter than her sister. C) She is smartest than her sister. D) She is very smartest than her sister.

a)

She is more smarter than her sister.

b)

She is smarter than her sister.

c)

She is smartest than her sister.

d)

She is very smartest than her sister.

56.

Identify the incorrect part: He is good in mathematics. A) He is B) good C) in D) mathematics

a)

He is

b)

good

c)

in

d)

mathematics

57.

Choose the correct sentence. A) He has been working here since two years. B) He has been working here for two years. C) He is working here since two years. D) He worked here since two years.

a)

He has been working here since two years.

b)

He has been working here for two years.

c)

He is working here since two years.

d)

He worked here since two years.

58.

Find the error: The teacher as well as the students were present. A) The teacher B) as well as C) the students D) were present

a)

The teacher

b)

as well as

c)

the students

d)

were present

59.

Choose the correct sentence. A) She suggested me to apply. B) She suggested to me to apply. C) She suggested that I apply. D) She suggested me applying.

a)

She suggested me to apply.

b)

She suggested to me to apply.

c)

She suggested that I apply.

d)

She suggested me applying.

60.

Identify the error: No sooner did he reached the station than the train left. A) No sooner B) did he C) reached

a)

No sooner

b)

did he

c)

reached

61.

Choose the correct option.

a)

The news are very shocking.

b)

The news is very shocking.

c)

The news were very shocking.

d)

The news have been shocking.

62.

Find the incorrect part: He is senior than me in this office.

a)

He is

b)

senior

c)

than

d)

me

63.

Choose the grammatically correct sentence.

a)

I prefer tea than coffee.

b)

I prefer tea to coffee.

c)

I prefer tea over than coffee.

d)

I prefer tea more than coffee.

64.

If CAT is coded as DBU, how is DOG coded?

a)

EPH

b)

EOG

c)

DPH

d)

EPH

65.

If A = 1, B = 2, ... Z = 26, what is the code for BAT?

a)

23

b)

25

c)

24

d)

22

66.

If PEN is coded as QFO, how is INK coded?

a)

JOL

b)

JML

c)

JNK

d)

JKL

67.

If MONDAY is coded as NPOEBZ, how is SUNDAY coded?

a)

TVOEBZ

b)

TVOEBZ

c)

TVOEBZ

d)

TVOEBZ

68.

If 246 is coded as 135, how is 579 coded?

a)

468

b)

468

c)

468

d)

468

69.

If TREE is coded as UQGG, how is LEAF coded?

a)

MFBG

b)

MDBG

c)

MEBG

d)

MDFG

70.

If BOOK is written as CPPL, how is WORD written?

a)

XPSF

b)

XPRF

c)

WPSD

d)

XPSE

71.

If 3 → 9, 4 → 16, 5 → 25, then 7 → ?

a)

35

b)

42

c)

49

d)

56

72.

If SOUTH is coded as TPUWI, how is NORTH coded?

a)

OPSUI

b)

OPSUI

c)

OPSUI

d)

OPSUI

73.

If TABLE is coded as 20-1-2-12-5, how is CHAIR coded?

a)

3-8-1-9-18

b)

3-7-1-9-18

c)

3-8-1-9-17

d)

3-8-1-8-18

74.

If 1 = A, 2 = B, ..., 26 = Z, what is the code for 19-21-14?

a)

SUN

b)

RUN

c)

FUN

d)

SON

75.

If CLOCK is coded as DMPDL, how is WATCH coded?

a)

XBUFK

b)

XBUCI

c)

XBVFK

d)

XBVFI