Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSI Coding Quiz

Total questions: 20

Worksheet time: 39mins

Name
Class
Date
1.
a)

/

b)

%

c)

bitwise operator

d)

*

2.
a)

10 5 3 4

b)

10 5 4 4

c)

10 5 3 3

d)

10 5 4 3

3.

int a = 10;

int b = a++ + ++a;

printf("%d %d %d %d",b , a++ ,a, ++a);

(a)  

4.

int a = 3;

printf("%d %d %d %d",++a , a++ ,a, --a);

(a)  

5.



(a)  

6.

a)

44

b)

55

c)

1510

d)

error

7.
a)

20

b)

10

c)

9

d)

1

8.
a)

4 4

b)

4 1

c)

1 4

d)

1 1

9.



(a)  

10.
a)

-65535 -65535

b)

65535 -65536

c)

-65535 65535

d)

65535 65535

11.

In a C Program if

int a = 5;

Int *ptr = &a;

then the printf statement with

&a, a, *ptr , ptr

a)

adrress, Value, Value, Adress

b)

address, value, value, value

c)

all address

d)

All values

12.

In a C program,

int a = 20;

*ptr = &a;

**dptr = &ptr;

printf ("%d", **dptr);


prints

a)

address of a

b)

address of ptr

c)

value of a

d)

address of dptr

13.

What does this command do?.

a)

Creates a pointer of type integer that is initially pointing to null.

b)

Creates a pointer of type integer that is initially pointing to 0.

c)

Creates a pointer in the heap

d)

None of the answers are valid

14.

If ptr is a pointer variable pointing to an array, then

"printf("%d",*(ptr++)) ;"

statement will print :

a)

Next location address

b)

Next location index value

c)

Next location value

d)

Compile time error

15.

What will be output?

int i=10;

int *p;

p=&i;

i+=5;

printf("\n i=%d *p=%d", i,*p)

a)

i=10, *p=10

b)

i=10, *p=15

c)

i=15, *p=15

d)

i=15, *p=10

16.

Point out the compile time error in the program given below.

#include<stdio.h>


int main()

{

int *x;

*x=100;

return 0;

}

a)

Error: invalid assignment for x

b)

Error: suspicious pointer conversion

c)

No error

d)

None of the above

17.

In Python, what serves as a reference to objects in memory, enabling dynamic memory management?

a)

Pointer

b)

Reference

c)

Variable

d)

Memory address

18.

What will be the value of the following Python expression?

4 + 3 % 5

a)

1.4

b)

35

c)

4

d)

7

19.

# include <stdio.h>

void fun(int *p){

*p = 10;

}

int main()

{

int y = 5;

fun(&y);

printf("%d", y);

return 0;

}

a)

10

b)

5

c)

error

d)

address

20.

What will be the output of the following Python code?

a)

1 2 3

b)

error

c)

12

d)

None of the Mentioned