wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Code Chase Round-1

Total questions: 30

Worksheet time: 23mins

Name
Class
Date
1.

C language was developed by

a)

Dennis Rechard

b)

Dennis M. Ritchie

c)

Bjarne Stroustrup

d)

Anders Hejlsberg

2.

What is the output of the following printf


printf("%d",34+24/12%3*5/2-4);

a)

35

b)

-2

c)

34

d)

38

3.

What is the output of the following program?

#include<stdio.h>

main()

{

enum { india, is=7, GREAT };

printf("%d %d", india, GREAT);

}

a)

0 1

b)

0 2

c)

0 8

d)

Compile error

4.

int main ()

{

int x = 24, y = 39, z = 45;

z = x + y;

y = z - y;

x = z - y;

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

}

a)

24 39 63

b)

39 24 63

c)

24 39 45

d)

39 24 45

5.
What punctuation is used to indicate the beginning and end of code blocks?
a)
{ }
b)
-> <-
c)
BEGIN and END
d)
( and )
6.

The user can also write one or more statements in one line by separating semicolon (;)

a)

True

b)

False

7.
What does IDE stand for?
a)
Integrated Debugging Equipment
b)
Integrated Debugging Environment
c)
Integrated Development Equipment
d)
Integrated Development Environment
8.

Which of the following not relevant to AI?

a)

It can perform only with a human intervention

b)

It is for real time analytics and decision making

c)

Reduce dependence on manual process

d)

It is a simulation of human intelligence

9.

Which of the following is not an IOT feature?

a)

Things that collect and act with manual intervention only

b)

Things that collect information & send it

c)

Things that collect and act on it

d)

Things that receive information & act on it

10.

What is the full form of API?

a)

Application programming interface

b)

Application programming internet

c)

Application programming interact

d)

Application performing interface

11.

How many bytes does "int = D" use?

a)

0

b)

1

c)

2 or 4

d)

8

12.

A pointer is a memory address. Suppose the pointer variable has p address 1000, and that p is declared to have type int*, and an int is 4 bytes long. What address is represented by expression p + 2?

a)

1002

b)

1004

c)

1008

d)

1006

13.

C language was invented to develop which Operating System?

a)

Android

b)

Linux

c)

Ubuntu

d)

Unix

14.

C is _______ type of programming language ?

a)

Object Oriented

b)

Procedural

c)

Bit level language

d)

Functional

15.

How many times will the following loop execute?

for(j = 1; j <= 10; j = j-1)

a)

Forever

b)

Never

c)

0

d)

1

16.

Consider the following C declaration :

struct {

short s[5]

union{

float y;

long z;

}u;

}t;

Assuming that objects of the type short,float and long occupy 2 bytes,4 bytes and 8 bytes respectively. The memory requirement for variable t, ignoring alignmenmt considerations, is :

a)

22 bytes

b)

18 bytes

c)

14 bytes

d)

10 bytes

17.

What is the output of the below code snippet?

#include<stdio.h>


main()

{

for(;;)printf("Hello");

}

a)

A-Infinite loop

b)

B - Prints “Hello” once.

c)

C - No output

d)

D - Compile error

18.

Choose the correct program that round off x value (a float value) to an int value to return the output value 4,

a)

A - float x = 3.6;

int y = (int)(x + 0.5);

printf ("Result = %d\n", y );

b)

B - float x = 3.6;

int y = int(x + 0.5);

printf ("Result = %d\n", y );

c)

C - float x = 3.6;

int y = (int)x + 0.5

printf ("Result = %d\n", y );

d)

D - float x = 3.6;

int y = (int)((int)x + 0.5)

printf ("Result = %d\n", y );

19.

What is the correct syntax to declare pointer to pointer i.e., double pointer?

a)

type **pointer_name;

b)

type *&pointer_name;

c)

type *(*pointer_name);

d)

type **(pointer_name);

20.

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

21.

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

22.

r+ mode in C file handling is for?

a)

Reading files

b)

Read and write files

c)

append in file

d)

read and append files

23.

Structure is a variable which holds____________________

a)

Different data types

b)

similar data types

c)

only int and float

d)

only int and char

24.

which of the following structure definition is correct one?

a)

struct stu

{

----}s

b)

struct stu

{

----}s;

c)

struct stu

{

----};

d)

both b and c

25.

Which header file is mandatory for DYNAMIC MEMORY ALLOCATION

a)

stdio.h

b)

math.h

c)

stdlib.h

d)

dos.h

26.

What is correct about calloc() function?

a)

Allocates the space for elements of an ARRAY

b)

initialize the elements to 0

c)

If the space is insufficient then return NULL pointer

d)

ALL of these

27.

Memory allocation using malloc() is done in?

a)

Static area

b)

Heap area

c)

Stack area

d)

Both Stack & Heap area

28.

Which one is used during memory deallocation in C?

a)

free(p);

b)

terminate(p);

c)

delete(p);

d)

remove(p);

29.

Difference Between array and calloc()

a)

array: Size is fixed

calloc () : fixed size

b)

array: Size is fixed & static

calloc () : fixed size & dynamic

c)

array: Size is fixed & dynamic

calloc () : fixed size & dynamic

d)

array: Size is fixed & static

calloc () : fixed size can be altered & dynamic

30.

How may arguments does relloc() takes?

a)

2

b)

1

c)

3