wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz 1

Total questions: 7

Worksheet time: 11mins

Name
Class
Date
1.

In C++, the natural logarithm function log ( ) can be accessed through the header file <cmath> ; which makes log ( ) function a :

a)

Pre-defined function

b)

User-defined function

c)

Standard library function

d)

None of the them

e)

All of them

2.

How many parameters are declared in the following statement which contains the declaration of a function?

int Test (int x, double y, float z, char p, n)

*Type only the number as answer*

(a)  

3.

What shall be the output of the program?

a)

82

54.67

34.833

b)

82.503

54.67

27.833

c)

81

54.67

27.833

d)

89.503

54.67

34.833

e)

82

54.67 27.833

4.

Differentiate between variable declaration and function declaration using an example.

4 lines
5.

The argument passed by "value" to a function can be :

a)

a variable

b)

a constant

c)

an expression

d)

all of them

6.

int module (int, int&);

int main()

{ int a = 80, b = 129, c = 144;

module(a, c);

cout << "a = " << a << ", b = " << c; }

int module (int x, int& y)

{ y = x; }

Choose the correct program output.

a)

a = 80

b = 80

b)

a = 80, b = 129

c)

a = 80

b = 144

d)

a = 80, b = 80

e)

a = 80, c = 144

7.

Choose the correct program output.

a)

6

b)

bool

c)

returns 7

d)

7