wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ICT4-CP: C-Sharp

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

The result of p | q if p is 0 and q is 1 will be:

a)

0

b)

1

c)

a negative number

d)

an error

2.

If A = 60; and B = 13, then A&B in binary format will be:

a)

0011 0001

b)

0011 1101

c)

0000 1100

d)

0000 1100

3.

Assume variable A holds 60 and variable B holds 13, then (A ^ B) equals:

a)

12

b)

61

c)

-61

d)

49

4.

If the left operands value is moved right by the number of bits specified by the right operand, the bitwise

operator is.

a)

Binary Right Shift Operator

b)

Binary Left Shift Operator

c)

Binary Ones Complement Operator

d)

Binary XOR Operator

5.

Which of the following are Assignment operators in C#?

a)

1, 2, 3

b)

1, 3, 4

c)

2, 4, 5

d)

3, 4, 5

6.

Which of the following operator returns the address of a variable in C#?

a)

? :

b)

^

c)

&

d)

>

7.

Which of the following operator assigns values from right side operands to left side operand in C#?

a)

%=

b)

=

c)

>>=

d)

&=

8.

Which of the following operator returns the type of a class in C# ?

a)

sizeof

b)

typeof

c)

&

d)

*

9.

Which of the following operator creates a pointer to a variable in C# ?

a)

sizeof

b)

typeof

c)

&

d)

*

10.

The assignment operators cannot be overloaded.

a)

true

b)

false

c)

Neither true or false.

d)

There are no correct choices.

11.

An if statement can have

a)

One else

b)

More than one else

c)

Nested if else statements

d)

All of the choices are correct

12.

This is used to select from multiple different blocks of code.

a)

if statement

b)

if else statement

c)

if else if else statement

d)

switch statement

13.

It allows to specify the code that should run, if the condition in the first if statement evaluates to false.

a)

if statement

b)

if else statement

c)

if else if else statement

d)

switch statement

14.

This is used to execute some code ONCE, only when a specified condition is true.

a)

if statement

b)

if else statement

c)

if else if else statement

d)

switch statement

15.

It allows use to execute code based on a predefined set choices.

a)

if statement

b)

if else statement

c)

if else if else statement

d)

switch statement

16.

It is used to control the flow of our programs and allow us to run certain blocks of code once, only if a

certain condition is true.

a)

expression

b)

constant constructs

c)

sequential constructs

d)

decision constructs

17.

It allows to specify the code that should run, if the condition in the first if statement evaluates to false.

a)

if statement

b)

if else statement

c)

if else if else statement

d)

switch statement

18.

It selects a statement for execution based on the value of a Boolean expression.

a)

if statement

b)

if else statement

c)

if else if else statement

d)

switch statement

19.

It executes only one statement from multiple given statements associated with conditions.

a)

if statement

b)

if else statement

c)

if else if else statement

d)

switch statement

20.

It terminates the case in the switch statement where it is placed.

a)

end

b)

go to

c)

break

d)

continue

21.

A loop statement in C# that repeatedly executes a target statement as long as a given condition is true.

a)

do...while loop

b)

for loop

c)

nested loop

d)

while loop

22.

Control structure that allows you to efficiently write a loop that needs to execute a specific number of

times.

a)

do...while loop

b)

for loop

c)

nested loop

d)

while loop

23.

A loop statement that checks its condition at the end of the loop.

a)

do...while loop

b)

for loop

c)

nested loop

d)

while loop

24.

A loop statement in C# that allows to use one loop inside another loop.

a)

do...while loop

b)

for loop

c)

nested loop

d)

while loop

25.

It terminates the switch statement and transfers execution to the statement immediately following the

switch.

a)

condition statement

b)

increment statement

c)

break statement

d)

continue statement

26.

It forces the next iteration of the loop to take place, skipping any code in between.

a)

condition statement

b)

increment statement

c)

break statement

d)

continue statement

27.

It is an endless loop by leaving the conditional expression empty.

a)

finite loop

b)

infinite loop

c)

increment loop

d)

decrement loop

28.

It can be used to terminate a case in the switch statement.

a)

condition statement

b)

increment statement

c)

break statement

d)

continue statement

29.

The init step is executed and the condition is evaluated before it jumps back to the increment statement.

a)

do...while loop

b)

for loop

c)

nested loop

d)

while loop

30.

A loop statement that is guaranteed to execute at least one time.

a)

do...while loop

b)

for loop

c)

nested loop

d)

while loop

31.

What will be the output of the code snippet given below?

a)

10

b)

20

c)

30

d)

Compile Error / Syntax Error

32.

Which of the following statements are correct about the following code snippet?

a)

1, 3

b)

2, 4

c)

4, 5

d)

1, 4

33.

Which of the following is NOT an Arithmetic operator in C#?

a)

**

b)

+

c)

/

d)

%

34.

Which of the following are NOT Relational operators in C#?

a)

1, 3

b)

2, 4

c)

3, 5

d)

4, 5

35.

Which of the following are Logical operators in C#?

a)

1, 2, 3

b)

1, 3, 4

c)

2, 4, 5

d)

3, 4, 5

36.

The operator shown by "x % y" is called:

a)

percentage

b)

conversion specifier

c)

modulus

d)

multiplication

37.

What expression denotes "x is not equal to y"?

a)

x//y

b)

x

c)

x neg y

d)

x!=y

38.

What is the expression in C# for "less than or equal to"?

a)

<

b)

<=

c)

>=

d)

<==

39.

What is the logical "or" operator?

a)

&&

b)

!!

c)

||

d)

OR

40.

The operator shown by "x/y" is

a)

multiplication

b)

division

c)

addition

d)

negation

41.

Which of the following preprocessor directive specifies the end of a conditional directive in C#?

a)

elif

b)

endif

c)

if

d)

else

42.

Which of the following preprocessor directive lets you modify the compiler's line number and optionally the

file name output for errors and warnings in C#?

a)

elif

b)

endif

c)

line

d)

region

43.

It is a decrement operator that decreases integer value by one.

a)

> =

b)

! =

c)

- -

d)

= =

44.

It checks if the values of two operands are equal or not and if values are not equal then condition becomes

true.

a)

> =

b)

! =

c)

- -

d)

= =

45.

It is called a Modulus Operator and the remainder of after an integer division.

a)

%

b)

/

c)

- -

d)

||

46.

It is an operator that divides numerator by de-numerator.

a)

%

b)

/

c)

- -

d)

||

47.

It is an operator that is used to reverse the logical state of its operand, and if a condition is true then the

operator will make false.

a)

%

b)

! =

c)

- -

d)

!

48.

It is an operator that if any of the two operands is non zero then condition becomes true.

a)

%

b)

/

c)

&&

d)

||

49.

It is an operator that If both the operands are non zero, then condition becomes true.

a)

%

b)

/

c)

&&

d)

||

50.

It is an increment operator that increases integer value by one

a)

> =

b)

++

c)

--

d)

!=