wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SDF_B10B12Tutorial_December26

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Predict the output of the given code.

a)

Garbage Value

b)

10

c)

0

d)

Error

2.

Predict the output of the given code.

a)

200 100

b)

100 200

c)

0 25

d)

25 0

3.

Predict the output of the given code.

a)

Hello

b)

Error

c)

WorldC Programming

d)

HelloC Programming

4.

Predict the output of the given code.

a)

0 1 2 3 4 5

b)

Error

c)

5

d)

6

5.

Predict the output of the given code.

a)

8 9

b)

8 8

c)

7 8

d)

8 17

6.

Which of the following is equivalent to the given expression?

a)

(x<y) && (y>=z)

b)

(x>=y) && (y>=z)

c)

( x < y ) && ( y < z )

d)

( x < y) || ( y < z )

7.

Which of the following evaluates to TRUE for a=5, b=-3 and c=0?

a)

( a < b ) || ( c < b )

b)

( c < a ) && ( c < b )

c)

( a > b ) && !c

d)

!( a + b > c )

8.

How to represent the given statement "donation is in the range 4000-5000 or guest is 1" using C language?

a)

donation >= 4000 and donation <= 5000 || guest == 1

b)

donation > 4000 and donation < 5000 || guest == 1

c)

donation > 4000 and donation < 5000 || guest = 1

d)

donation >= 4000 and donation <= 5000 || guest = 1

9.

Which of the following array declaration is correct?

a)

int a(3);

b)

int size=3;

int a[3];

c)

int 3[a];

d)

int a[size];

int size = 3;

10.

Choose an equivalent single C statement for "Decrements the variable n and then adds it to the variable total".

a)

total + n--

b)

n+=1;

total+n

c)

n+=1;

total + --n

d)

total + --n