wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Functions on C

Total questions: 15

Worksheet time: 17mins

Name
Class
Date
1.

main()

{

printf("%p",main);

}

a)

Error

b)

Will make an infinite loop

c)

Some address will be printed

d)

None of the above

2.

main()

{

int i = abc(10);

printf("%d",--i);

}

int abc(int i)

{

return(i++);

}

a)

10

b)

9

c)

11

d)

None of the above

3.

In C , parameters are always

a)

Passed by value

b)

Passed by reference

c)

Non-pointer variables are passed by value and pointers are passed by reference

d)

Passed by value result

4.

Select the correct statements

a)

The body of a function should have only one return statement.

b)

The body of the function may have many return statements.

c)

A function can return only one value to the calling environment

d)

If return statement is omitted,then the function does it's job but returns no value to the calling environment.

5.

Which of the following is a complete function?

a)

int function()

b)

int function(int x){

return x=x+1;

}

c)

void function(int){printf("Hello");}

d)

void function(x){printf("Hello");}

e)

None of these

6.

int f (int x)

{

if(x<=4)

return x;

return f(--x);

}

void main()

{

printf("%d", f(7));

}

a)

4 5 6 7

b)

1 2 3 4

c)

4

d)

Syntax error

e)

Runtime error

7.

The function scanf returns

a)

The actual values read for each argument.

b)

1

c)

0

d)

The number of successful read input values.

e)

ASCII value of the input read.

8.

Which of the following functions calculates the square of 'x' in C

a)

sqr(x)

b)

pow(2,x)

c)

pow(x,2)

d)

power(2,x)

e)

power(x,2)

9.

A function which calls itself is called as

a)

Self Function

b)

Auto Function

c)

Recursive Function

d)

Static Function

10.

Choose correct statements about C language Pass By Value

a)

Pass By Value copies the variables value in one or more memory location.

b)

Pass By Value doesn't use pointers.

c)

Pass By Value protects your source or original variables from changes in outside functions or called functions

d)

All the above

11.

What is the limit for number of functions in a C Programming?

a)

16

b)

64

c)

32

d)

No limit

12.

What characters are allowed in a C function name identifier?

a)

Alphabets, Numbers,%,$,_

b)

Alphabets, Numbers,Underscore(_)

c)

Alphabets, Numbers,$

d)

Alphabets, Numbers,%

13.

Arguments passed to a function in C Language are called ____ arguments

a)

Formal arguments

b)

Actual arguments

c)

Definite argument

d)

Ideal arguments

14.

Arguments received by a function in C language are called ___ arguments

a)

Definite argument

b)

Actual arguments

c)

Formal arguments

d)

Ideal arguments

15.

Select correct options about C language function arguments

a)

Number of arguments should be same when sending and receiving

b)

Type of each argument should match exactly

c)

Order of each argument should be same

d)

All of the above