Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

IT club - Quize

Total questions: 12

Worksheet time: 14mins

Name
Class
Date
1.

Which keyword is used to define a constant in C?

a)

static

b)

final

c)

const

d)

constant

2.

Which of the following is not a valid variable name in C?

a)

total_marks

b)

_value

c)

float

d)

sum1

3.

Which statement about variables inside a function is true?

a)

They are global by default

b)

They are local to that function

c)

They cannot be static

d)

They can only store integers

4.

Which function is used to compare two strings in C?

a)

strcopy()

b)

strcmp()

c)

strcomp()

d)

compare()

5.

What is the default value of a local variable in C?

a)

0

b)

Null

c)

Garbage value

d)

-1

6.

What does the continue statement do in a loop?

a)

Terminates the program

b)

Skips the current iteration

c)

Restarts the program

d)

Exits from the loop

7.

Which of the following cannot be used with switch statement?

a)

int

b)

char

c)

float

d)

Enum

8.

What is the output of this code?

int a = 5;

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

a)

5 5

b)

5 6

c)

6 5

d)

Undefined / unspecified

9.

Which operator is used to get the address of a variable?

a)

@

b)

*

c)

&

d)

%

10.

What will be the result of dividing any integer by zero in C?

a)

0

b)

Infinity

c)

Compile-time error or runtime crash

d)

Undefined but continues

11.

#include <stdio.h>

int main()

int i = 0;

while (Missing Logic) {

i += 2;

printf("%d ", i);

}

return 0;

}

Output: 2 4 6 8 10

(a)  

12.

What is the output of the following code?

#include <stdio.h>

int main() {

char ch = 'A';

printf("%c", ch + 1);

return 0;

}

(a)