Question

In a void function, if the return statement is not given, what will be the outcome? Select one: The program never returns from the function There is no error and the function will return after executing the code in the body of the function. The compiler throws an error and prevents the program from getting compiled The program stops executing and errors out at the end of the function.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: B (There won't be any error)

\;\;

Add a comment
Know the answer?
Add Answer to:
In a void function, if the return statement is not given, what will be the outcome?...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I getting the error when creating query for PL/SQL CREATE OR REPLACE FUNCTION Customer_Details RETURN VARCHAR2;...

    I getting the error when creating query for PL/SQL CREATE OR REPLACE FUNCTION Customer_Details RETURN VARCHAR2; IS Cust_Name VARCHAR2 (20); BEGIN SELECT FirstName INTO Cust_Name FROM Customer WHERE CustomerID = '300001'; RETURN Cust_Name; END; / I'm getting the error: 3/1 PLS-00103: Encountered the symbol "IS" Errors: check compiler log

  • please explain [5 pts] What is the outcome of compiling and executing the following code. Assume...

    please explain [5 pts] What is the outcome of compiling and executing the following code. Assume it is embedded in an otherwise correct and complete C++ program void printBackwards(int *arr, int len){ if (len <=0) return; cout< } int main(){ int arr[4] = {1, 2, 3, 4}; printBackwards(arr, 4); } [10 pts] Implement a function that returns the minimum value in an integer array ​‘arr’​ of length ‘len’​. You MUST use a RECURSIVE solution. //Precondition: An integer array with length...

  • The function retrieveAt of the class arrayListType is written as a void function. Rewrite this function...

    The function retrieveAt of the class arrayListType is written as a void function. Rewrite this function so that it is written as a value returning function, returning the required item. If the location of the item to be returned is out of range, use the assert function to terminate the program. note: please give all code in c++ below is the class and implementation(a test program would be helpful in determining how to use it): class arrayListType { public:    ...

  • Follow program instructions carefully. spacing is important. I think It needs a static void main too....

    Follow program instructions carefully. spacing is important. I think It needs a static void main too. Need to run it! You are to write a class called Point – this will represent a geometric point in a Cartesian plane (but x and y should be ints).   Point should have the following: Data:   that hold the x-value and the y-value. They should be ints and must be private. Constructors: A default constructor that will set the values to (2,-7) A parameterized...

  • Lab 3 Step One First, create an empty directory for lab3. There is no starter code for this lab. You will be throwing an...

    Lab 3 Step One First, create an empty directory for lab3. There is no starter code for this lab. You will be throwing and catching exceptions in this exercise. Create a file called RuntimeException.h and put the following code in it. #include <string> class RuntimeException { private: string errorMsg; public: RuntimeException(const string& err) { errorMsg = err; } string getMessage() const { return errorMsg; } } Step Two In a new .cpp file in your directory, write a main function...

  • Lab 3 Step One First, create an empty directory for lab3. There is no starter code...

    Lab 3 Step One First, create an empty directory for lab3. There is no starter code for this lab. You will be throwing and catching exceptions in this exercise. Create a file called RuntimeException.h and put the following code in it. #include <string> class RuntimeException { private: string errorMsg; public: RuntimeException(const string& err) { errorMsg = err; } string getMessage() const { return errorMsg; } } Step Two In a new .cpp file in your directory, write a main function...

  • 1-Is it possible to run a program without a main() function? Yes No 2- How many...

    1-Is it possible to run a program without a main() function? Yes No 2- How many main() functions can one have in a program? 2 This depends on what compiler you use. As many as you like 1 3- What does the following code fragment leave in x? char a = 'A'; int x = sizeof (a); 1 Depends on what compiler you use. 4 2 4- True or false: In a C program I can have two functions with...

  • The first project involves modifying the attached lexical analyzer and the compilation listing ge...

    The first project involves modifying the attached lexical analyzer and the compilation listing generator code. You need to make the following modifications to the lexical analyzer, scanner.l: 1. A second type of comment should be added that begins with // and ends with the end of line. As with the existing comment, no token should be returned. 2. The definition for the identifiers should be modified so that underscores can be included, however, consecutive underscores, leading and trailing underscores should...

  • ​​​​​​ 11.   A _____________ error does not cause the compiler to generate an error, but does...

    ​​​​​​ 11.   A _____________ error does not cause the compiler to generate an error, but does cause the program to produce incorrect results. Syntax, logic, variable name, function name 12.   A syntax error occurs when the programmer violates one or more grammar rules of the C language. True or False 13.   Given this line of code: y = sqrt(x); x would be known as the argument. True or False 14.   A void function does not return a value to the...

  • Using PuTTY Linux Server Task Compiling:             1) Download the two files from blackboard, driver.cpp, and...

    Using PuTTY Linux Server Task Compiling:             1) Download the two files from blackboard, driver.cpp, and circle.h             2) Create a new directory to store the files in             3) Compile the code a) Run the command g++ driver.cpp -o executable_name, this will compile the code both for driver.cpp and the referenced file circle.h note: -o parameter specifies a new name for the executable, if you do not specify the “-o” parameter the default name of the executable is “a.out”...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT