Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C Viva

Total questions: 10

Worksheet time: 2mins

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.

How many keywords are there in C language?

a)

32

b)

33

c)

64

d)

18

3.

What is an identifier in C language?

a)

An identifier is a combination of alphanumeric characters used for conditional and control statements

b)

An identifier is a combination of alphanumeric characters used for any variable, function, label name

c)

Both A and B

d)

None of the above

4.

A C-style comment, simply surround the text with ___.

a)

/* and */

b)

// and //

c)

//

d)

/** and **/

5.

Which are the fundamental data types in C?

a)

char

b)

int

c)

float

d)

All of these

6.

For which type, the format specifier "%i" is used?

a)

int

b)

char

c)

float

d)

double

7.

Which is the correct format specifier for double type value in C?

a)

%d

b)

%f

c)

%lf

d)

%LF

8.

What is the correct syntax to declare a variable in C?

a)

data_type variable_name;

b)

data_type as variable_name;

c)

variable_name data_type;

d)

variable_name as data_type;

9.

Which of the following is not an arithmetic expression?

a)

x = 10

b)

x /= 10

c)

x %= 10

d)

x != 10

10.

What will be the output of the following C code?

#include <stdio.h>

int main()

{ int x = 20;

x %= 3;

printf("%d",x);

return 0; }

a)

2

b)

2.5

c)

Error

d)

Warning