Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Round1

Total questions: 25

Worksheet time: 8mins

Name
Class
Date
1.

Guess the output of following C code

int x=10;

printf(x);

a)

10

b)

x

c)

no output

d)

compile error

2.

What will be the output of the following C code?

int a=5, b=10;

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

a)

15

b)

510

c)

5+10

d)

compile error

3.

Identify the output of this C code snippet:

char c='A';

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

a)

B

b)

A

c)

compile error

d)

no output

4.

What will be printed by the following C code?

float f=3.14;

printf("%.1f", f);

a)

3.1

b)

3.14

c)

3.140

d)

compile error

5.

Which of the following is a valid data type in C?

a)

String

b)

char

c)

boolean

d)

list

6.

What does the if statement do in C?

a)

Executes a block of code repeatedly

b)

Executes a block of code only if a specified condition is true

c)

Exits a loop

d)

Declares a function

7.

What is the output of print(10 // 3) in Python?

a)

3.33

b)

3

c)

3.0

d)

4

8.

Which of the following is not a valid loop structure in Python?

a)

for

b)

while

c)

do-while

d)

for each

9.

What will be the output of the following C code?

int a=3, b=4, c=5;

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

a)

17

b)

12

c)

35

d)

7

10.

Which of the following is a valid way to declare a function in C?

a)

void functionName()

b)

functionName void()

c)

function voidName()

d)

void functionName[]

11.

What will be the output of the following Python code?

print(type(5))

a)

int

b)

float

c)

str

d)

list

12.

What will be the output of the following C code?

int x=7, y=3;

printf("%d", x/y);

a)

2

b)

2.33

c)

3

d)

compile error

13.

What will be the output of the following Python code?

print(10 % 3)

a)

1

b)

3

c)

10

d)

0

14.

Which is valid in Python?

a)

do while

b)

while condition:

#statement1

else:

#statement2

c)

Switch

d)

Structure

15.

Which of the following is a correct way to use a pointer in C?

a)

int *p;

b)

int p*;

c)

p int;

d)

int &p;

16.

Java is _____language

a)

Complied

b)

Interpreted

c)

Both

d)

None

17.

C is ____ language

a)

Procedural

b)

Object-oriented

c)

Functional

d)

Non-Procedural

18.

What is the purpose of the 'break' statement in C?

a)

To exit a loop

b)

To skip the current iteration

c)

To terminate the program

d)

To skip a line

19.

Founder of C ____

a)

Dennis M. Ritchie

b)

J J Thomson

c)

James Gosling

d)

Guido van Rossum

20.

Founder of Java ____

a)

Dennis M. Ritchie

b)

J J Thomson

c)

James Gosling

d)

Guido van Rossum

21.

Founder of python____

a)

Dennis M. Ritchie

b)

J J Thomson

c)

James Gosling

d)

Guido van Rossum

22.

Name of this operator( in lower case)

condition ? expression_if_true : expression_if_false;



(a)  

23.

CEO of Infosys

a)

Salil Parekh

b)

Narayana murthy

c)

Sudha murthy

d)

Vishal Sikka


24.

Identify the output of this Python code:

print(5 ** 2)

a)

10

b)

25

c)

5

d)

compile error

25.

What is the purpose of a struct in C?

a)

To define a new data type that can hold multiple related variables of different types

b)

To create a new function that can be used multiple times in a program

c)

To allocate memory dynamically at runtime

d)

To perform arithmetic operations on data