Can there be multiple return statements in a function?

1 Answer

Answer :

A: Yes, but only one of them is executed.

Related questions

Description : Which of the following do not represent legal flow control statements? A) break; B) return; C) exit(); D) continue outer;

Last Answer : C) exit();

Description : Which of the following do not represent legal flow control statements? A) break; B) return; C) exit(); D) continue outer;

Last Answer : C) exit();

Description : In C++, the keyword void was used ……….. A) To specify the return type of function when it is not returning any value. B) To indicate an empty argument list to a function. C) To declare the generic pointers. D) All of the above.

Last Answer : D) All of the above.

Description : What does the following expression means ? char *(*(* a[N]) ( )) ( ); (A) a pointer to a function returning array of n pointers to function returning character pointers. (B) a ... to characters (D) an array of n pointers to function returning pointers to functions returning pointers to characters.

Last Answer : Answer: A,B,C,D

Description : What is the value returned by the function f given below when n = 100 ? int f(int n)  { if (n==0) then return n;  else return n + f(n-2);  } (A) 2550 (B) 2556 (C) 5220 (D) 5520

Last Answer : (A) 2550

Description : Which of the following statements is correct regarding the internal rate of return (IRR) method? A. Each project has a unique internal rate of return. B. As long as you are not dealing with ... of return is rarely used by firms today because of the ease at which net present value is calculated

Last Answer : D. The internal rate of return is rarely used by firms today because of the ease at which net present value is calculated.

Description : Which of the following statements is correct regarding the internal rate of return (IRR) method? A. Each project has a unique internal rate of return. B. As long as you are not dealing with ... of return is rarely used by firms today because of the ease at which net present value is calculated.

Last Answer : D. The internal rate of return is rarely used by firms today because of the ease at which net present value is calculated.

Description : Which of the following statements is correct regarding the internal rate of return (IRR) method? A. Each project has a unique internal rate of return B. As long as you are not dealing with ... of return is rarely used by firms today because of the ease at which net present value is calculated

Last Answer : D. The internal rate of return is rarely used by firms today because of the ease at which net present value is calculated.

Description : When an array is passed as a parameter to a function which of the following statements is correct? (A) The function can change values in the original array. (B) The function cannot change values in the original array. (C) Results in compilation error. (D) Results in runtime error.

Last Answer : (A) The function can change values in the original array.

Description : When an array is passed as parameter to a function, which of the following statements is correct ? (A) The function can change values in the original array. (B) In C, parameters are passed by value, ... . (D) Results in a run time error when the function tries to access the elements in the array.

Last Answer : (A) The function can change values in the original array.

Description : Which of the following statements is incorrect for Parallel Virtual Machine (PVM)? (A) The PVM Communication model provides asynchronous blocking send, asynchronous blocking receive and non-blocking receive function. ... of such messages. (D) In PVM Model, the message order is not preserved. 

Last Answer : (D) In PVM Model, the message order is not preserved.

Description : Which one of the following statements, related to the requirements phase in Software Engineering, is incorrect ? (A) Requirement validation is one of the activities in the requirements phase. (B) ... . (D) Function points is one of the most commonly used size metric for requirements. 

Last Answer : (C) “Modelling-oriented approach” is one of the methods for specifying the functional specifications. 

Description : What is the use of return keyword?

Last Answer : A: return keyword is used to return any value from a function. It denotes the end of a function.

Description : What does System.in.read() return?

Last Answer : A: It returns the number of bytes read from the Input Stream as an integer.

Description : Methods can be overloaded with a difference only in the type of the return value .. A) Not supported B) False C) True D) None of the above

Last Answer : B) False

Description : State True or False. i) While overloading operators new operator can be overloaded. ii) The binary operator such as +, -, * and must explicitly return a value. A) True, True B) True, False C) False, True D) False, False

Last Answer : C) False, True

Description : State True or False i) A destructor never takes any argument nor does it return any value. ii) It releases memory space for future use. A) True, True B) True, False C) False, True D) False, False

Last Answer : A) True, True

Description : Which of the following characteristics of constructor are true. i) They should be declared in the public section. ii) They are invoked automatically when the objects are created. iii) They do not have return type and void also. ... and v C) Only i, iii, iv and v D) All i, ii, iii, iv and v

Last Answer : D) All i, ii, iii, iv and v

Description : Some of the situations where inline expansion may not work are: A) For functions returning values, if a loop, a switch or goto exists. B) If functions contain static variables and they are re-cursive. C) For functions not returning values, if return statement exist. D) All of the above.

Last Answer : D) All of the above.

Description : If a is an integer variable, a=7/3; will return a value A) 2.5 B) 3 C) 0 D) 2

Last Answer : D) 2

Description : The rate of ……………. Is always an important factor for management especially in relation to the rate of return A) Cost B) Benefit C) Sales D) Investment

Last Answer : D) Investment

Description : Which of the following commands would return process_id of sleep command? (A) Sleep 1 and echo $? (B) Sleep 1 and echo $# (C) Sleep 1 and echo $x (D) Sleep 1 and echo $!

Last Answer : (D) Sleep 1 and echo $!

Description : Consider the following three SQL queries (Assume the data in the people table) : (a) Select Name from people where Age>21; (b) Select Name from people where Height>180; (c) Select Name from people where (Age>21) or (Height ... number of rows returned by the SQL query (c) ? (A) 3 (B) 7 (C) 10 (D) 21

Last Answer : (C) 10

Description : Implicit return type of a class constructor is: (A) not of class type itself (B) class type itself (B) a destructor of class type (D) a destructor not of class type 

Last Answer : (B) class type itself

Description : Consider the following JAVA program: public class First { public static int CBSE (int x) { if (x < 100) x = CBSE (x +10); return (x - 1); } public static void main (String[] args){ System.out.print(First.CBSE(60)); } } What does this program print? (1) 59 (2) 95 (3) 69 (4) 99

Last Answer : (2) 95 

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : In Java servlet method init( ) is called ..................... times. A) 1 B) 2 C) 0 D) multiple

Last Answer : A) 1

Description : A portion of the Polymorphic virus, generally called a …………………….. , creates, a random encryption, key to encrypt the remainder of the virus. A) mutual engine B) mutation engine C) multiple engine D) polymorphic engine

Last Answer : C) multiple engine

Description : State true or false. i) Unix, support multiple user process but only support one thread per process. ii) A java run time environment is an example of a system of one process with multiple threads. A) True, False B) True, True C) False, True D) False, False

Last Answer : B) True, True

Description : ................ is the ability of multiple process to co-ordinate their activities by exchange of information A) Synchronization B) Mutual Exclusion C) Dead lock D) Starvation

Last Answer : A) Synchronization

Description : .................. refers to the ability of an operating system to support multiple threads of execution with a single process. A) Multithreading B) Multiprocessing C) Multiexecuting D) Bi-threading

Last Answer : A) Multithreading

Description : ………………… approach reduces time and effort required for design and lesser risk in database management. A) Single global database B) Top-down approach C) Multiple databases D) None of the above

Last Answer : C) Multiple databases

Description : It is better to use files than a DBMS when there are (A) Stringent real-time requirements. (B) Multiple users wish to access the data. (C) Complex relationships among data. (D) All of the above.

Last Answer : (B) Multiple users wish to access the data.

Description : Horn clauses are special kinds of propositions which can be described as (A) Single atomic proposition on left side. (B) Single or multiple atomic proposition on left side. (C) A single atomic ... proposition on right side. (D) A single atomic proposition on left side or an empty left side.

Last Answer : (D) A single atomic proposition on left side or an empty left side.

Description : Repository of information gathered from multiple sources, storing under unified scheme at a single site is called as (A) Data mining (B) Meta data (C) Data warehousing (D) Database

Last Answer : (C) Data warehousing

Description : Loop unrolling is a code optimization technique: (A) that avoids tests at every iteration of the loop (B) that improves performance by decreasing the number of instructions in a basic block. ... loops with outer loops (D) that reorders operations to allow multiple computations to happen in parallel.

Last Answer : (A) that avoids tests at every iteration of the loop

Description : State true or false for the following statements in Java. i) Java beans slow down software development process. ii) Java Servlets do not have built in multithreading feature. A) i-false, ii-false B) i-false, ii-true C) i-true, ii-false D) i-true, ii-true

Last Answer : A) i-false, ii-false

Description : What will be the values of x, m and n after execution of the following statements? Int x, m, n; m=10; n=15; x= ++m + n++; A) x=25, m=10, n=15 B) x=27, m=10, n=15 C) x=26, m=11, n=16 D) x=27, m=11, n=16

Last Answer : C) x=26, m=11, n=16

Description : Which of the following is/are the DDL statements? A) Create B) Drop C) Alter D) All of the above

Last Answer : D) All of the above

Description : ……………. Allows definitions and query language statements to be entered; query results are formatted and displayed. A) Schema Processor B) Query Processor C) Terminal Interface D) None of the above

Last Answer : C) Terminal Interface

Description : Which of the following statements create a dictionary? a) d = {} b) d = {“john”:40, “peter”:45} c) d = {40:”john”, 45:”peter”} d) All of the mentioned

Last Answer : d) All of the mentioned

Description : The statements s1 and s2 are given as: s1: Context sensitive languages are closed under intersection, concatenation, substitution and inverse homomorphism. s2: Context free languages are closed under complementation, ... is not correct and s2 is correct. (D) Both s1 and s2 are not correct.

Last Answer : (B) s1 is correct and s2 is not correct.

Description : Consider the following statements for priority queue: S1: It is a data structure in which the intrinsic ordering of the elements does determine the result of its basic operations. S2: The elements of a priority queue ... . (C) SI is incorrect and S2 is correct. (D) Both S1 and S2 are correct.

Last Answer : (D) Both S1 and S2 are correct.

Description : Which is the correct statement(s) for Non Recursive predictive parser? S1: First(α) = {t | α => * t β for some string β } => *tβ S2: Follow(X) = { a | S => * αXa β for some strings ... and S2 is correct. (C) S1 is correct and S2 is incorrect. (D) Both statements S1 and S2 are correct. 

Last Answer : (D) Both statements S1 and S2 are correct.

Description : Given the following statements: S1: Every context-sensitive language L is recursive. S2: There exists a recursive language that is not context sensitive. Which statement is correct? (A) S1 is not correct and S2 is ... (C) S1 is correct and S2 is not correct. (D) S1 is correct and S2 is correct.

Last Answer : (D) S1 is correct and S2 is correct.