wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

c programming-Test 1

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

%d format specifier does

a)

used to print an integer value.

b)

used to print a string.

c)

used to display a character value.

d)

used to display a floating point value.

2.

what is Global variable

a)

A variable which is declared inside function

b)

A variable which is declared outside function

c)

The scope of a variable is available within a function in which they are declared.

d)

Variables can be accessed only by those statements inside a function in which they are declared.

3.

Who is the father of C language?

a)

Steve Jobs

b)

James Gosling

c)

Dennis Ritchie

d)

Rasmus Lerdorf

4.

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

a)

int number;

b)

float rate;

c)

int variable_count;

d)

int $main;

5.

Which of the following is true for variable names in C?

a)

They can contain alphanumeric characters as well as special characters

b)

It is not an error to declare a variable to be one of the keywords(like goto, static)

c)

Variable names cannot start with a digit

d)

Variable can be of any length

6.

Which is valid C expression?

a)

int my_num = 100,000;

b)

int my_num = 100000;

c)

int my num = 1000;

d)

int $my_num = 10000;

7.

Which of the following cannot be a variable name in C?

a)

volatile

b)

true

c)

friend

d)

export

8.

Which of the following declaration is not supported by C language?

a)

String str;

b)

char *str;

c)

float str = 3e2;

d)

Both String str; & float str = 3e2;

9.

What is the result of logical or relational expression in C?

a)

True or False

b)

0 or 1

c)

0 if an expression is false and any positive number if an expression is true

d)

None of the mentioned

10.

Functions in C Language are always

a)

Internal

b)

External

c)

Both Internal and External

d)

External and Internal are not valid terms for functions