wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C Language

Total questions: 18

Worksheet time: 10mins

Name
Class
Date
1.

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

a)

int number;

b)

float _rate;

c)

int variable_Count;

d)

int $main;

2.

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

3.

What will be the output of this code?

a)

OK

b)

KO

c)

Depends on compiler

d)

Depends on standard

4.

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 ];

5.

A function that calls itself is known as _________.

a)

Repetation

b)

Retention

c)

Recursion

d)

looping

6.

How to write a single line comment?

a)

/* Comment */

b)

/* Comment

c)

//Comment//

d)

//Comment

7.

_________used to give tab spaces in c programming.

a)

/n

b)

\t

c)

\r

d)

\n

8.

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

9.

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

a)

Attatch

b)

Append

c)

Apprehend

d)

Add

10.

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

a)

stdlib.h

b)

conio.h

c)

stdio.h

d)

stdarg.h

11.

What is the output of this statement "printf("%d", (a++))" ?

a)

The value of (a + 1)

b)

The current value of a

c)

Error message

d)

Garbage

12.

Which statement can print \n on the screen?

a)

printf("\\n");

b)

printf("n\");

c)

printf("n");

d)

- printf('\n');

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

_______________to be included to use standard I/O functions : prinf(),scanf()

a)

#include<conio.h>

b)

#include<stdio.h>

c)

#include<string.h>

d)

#include<math.h>

15.

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

a)

True

b)

False

16.

Which is correct example for variable declaration?

a)

int a;b;c;

b)

Int a,b,c;

c)

int a,b,c;

d)

int a,b;c;

17.

The sizeof operator returns the size of its operand in bytes

a)

True

b)

False

18.

Every C statement ends with ------------?

a)

.

b)

;

c)

,

d)

}