QUIZ ON : C LANGUAGE - FUNCTIONS

FUNCTIONS

00:00:00

The data structure used to implement recursive function calls

Option A. Array
Option B. Linked list
Option C. Binary tree
Option D. Stack
True Answer D

Explanation :
The compiler uses the data type stack for implementing normal as well as recursive function calls.

The data structure used to implement recursive function calls

Question No# : 01 out of 20



Functions cannot return more than one value at a time.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

Functions cannot return more than one value at a time.

Question No# : 02 out of 20

In the absence of a exit condition in a recursive function, the following error is given

Option A. Compile time error
Option B. Run time error
Option C. Logical error
Option D. No error
True Answer B

Explanation :
When a recursive function is called in the absence of an exit condition, it results in an infinite loop due to which the stack keeps getting filled(stack overflow). This results in a run time error.

In the absence of a exit condition in a recursive function, the following error is given

Question No# : 03 out of 20



Recursion works faster than loops.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :
When a recursive call is made, the function/process clones itself and then process that funtion. This leads to time and space constrains. In a loop, there is no recursive call involved that saves a lot of time and space too.

Recursion works faster than loops.

Question No# : 04 out of 20

A ‘C’ function can contain many return statements.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

A ‘C’ function can contain many return statements.

Question No# : 05 out of 20

Functions may have several declarations, but only one definition.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :
Yes, you can have multiple declarations (or prototypes), but you can only have one function definition for a given function name in C, or function name + arguments in C++. This needs to be supported for the very frequent situation where a function has prototypes in several include files but only one definition.

Functions may have several declarations, but only one definition.

Question No# : 06 out of 20

Names of functions in two different files linked together can be same

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :
If two function are declared in a same name, it gives "Error: Multiple declaration of function_name())".

Names of functions in two different files linked together can be same

Question No# : 07 out of 20

Functions cannot return more than one value at a time

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :
The default return type for a function is int.

Functions cannot return more than one value at a time

Question No# : 08 out of 20

Functions can be called either by value or by reference.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

Functions can be called either by value or by reference.

Question No# : 09 out of 20

Recursion cannot call a function itself.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

Recursion cannot call a function itself.

Question No# : 10 out of 20

In ‘C’, parameters to a function can be passed by value but not by reference.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

In ‘C’, parameters to a function can be passed by value but not by reference.

Question No# : 11 out of 20

Functions can be called only by value

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :
A function can be called either call by value or call by reference. Example: Call by value means c = sub(a, b); here value of a and b are passed. Call by reference means c = sub(&a, &b); here address of a and b are passed.

Functions can be called only by value

Question No# : 12 out of 20

A function in ‘C’ must have at least one argument.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

A function in ‘C’ must have at least one argument.

Question No# : 13 out of 20

Which of the following function declaration need not have a return statement in its body?

Option A. int a(char *s)
Option B. void b(int a[], int n)
Option C. float *c()
Option D. short d(long x)
True Answer B

Explanation :

Which of the following function declaration need not have a return statement in its body?

Question No# : 14 out of 20

In a function two return statements should never occur.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

In a function two return statements should never occur.

Question No# : 15 out of 20

Every function must return a value

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :
If a function return type is declared as void it cannot return any value.

Every function must return a value

Question No# : 16 out of 20

The value obtained in the function is given back to main by using ________ keyword.

Option A. return
Option B. static
Option C. new
Option D. volatile
True Answer A

Explanation :

The value obtained in the function is given back to main by using ________ keyword.

Question No# : 17 out of 20



Functions can return a floating point number.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :
Yes, you can use float as a return type in C. Yes you can use, write prototype before calling that function otherwise compiler will assume it has a int and returns the int value.

Functions can return a floating point number.

Question No# : 18 out of 20

In C all functions except main() can be called recursively.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :
Any function including main() can be called recursively.

In C all functions except main() can be called recursively.

Question No# : 19 out of 20

A self contained block of statements that perform a coherent task of some kind is called a

Option A. Monitor
Option B. Function
Option C. Program
Option D. Structure
True Answer B

Explanation :

A self contained block of statements that perform a coherent task of some kind is called a

Question No# : 20 out of 20


CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad