wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Anits Sample Mock Test-I

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

Who is the father of C-Language?

a)

Steve Jobs

b)

James Gosling

c)

Dennis Ritche

d)

Rasmus Lerdorf

2.

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

a)

int number;

b)

float _rate;

c)

int variable_Count;

d)

int $main;

3.

Which of the following is known as Exit Controlled Loop?

a)

for loop

b)

do while loop

c)

while loop

d)

All of these

4.

Which is the correct example of declaring functions?

a)

int add(int [],int);

b)

int add(int, int);

c)

int add(int a, int b);

d)

All of these

5.

Strcmp() is used to ___________.

a)

Find the length of the string.

b)

Copies one string over another.

c)

Compare two strings.

d)

Concatenates two strings.

6.

What is the value of "z" in this code?

a)

The value of z is 10

b)

The value of z is 15

c)

The value of z is 15.6

d)

The value of z is 16

7.

What will be the output of this code?

a)

OK

b)

KO

c)

Depends on compiler

d)

Depends on standard

8.

All keywords in C are ________.

a)

lowercase

b)

uppercase

c)

Camelcase

d)

None of these

9.

What is the correct way of initializing an array in C?

a)

int arr[4]= 1,2,3,4 ;

b)

int arr[4]= (1,2,3,4) ;

c)

int arr[4]= {1,2,3,4 };

d)

int arr[4]= [1,2,3,4 ];

10.

A function that calls itself is known as _________.

a)

Repetation

b)

Retention

c)

Recursion

d)

looping

11.

What is structure in C?

a)

It is a primary datatype.

b)

It is a derived datatype.

c)

It is a user defined datatype.

d)

None of these

12.

How to capture the string in C? (declared as- char str[100]; )

a)

scanf( "%c", str);

b)

scanf( "%s", str);

c)

scanf( "%c", &str);

d)

scanf( "%s", &str);

13.

What is the output of this code?

a)

1 1

b)

5 1

c)

1 5

d)

1 13465

14.

How many types of operators there are?

a)

7

b)

9

c)

8

d)

10

15.

How to write a single line comment?

a)

/* Comment */

b)

/* Comment

c)

//Comment//

d)

//Comment

16.

_________used to give tab spaces in c programming.

a)

/n

b)

\t

c)

\r

d)

\n

17.

The program that translates your code from a high-level language to the binary language is called ________.

a)

programmer

b)

compiler

c)

translator

d)

linker

18.

What is meant by "a" in the following C operation?

a)

Attatch

b)

Append

c)

Apprehend

d)

Add

19.

1 byte =8 bits

a)

True

b)

False

20.

scanf() is a predefined function of _______ header file.

a)

stdlib.h

b)

conio.h

c)

stdio.h

d)

stdarg.h