answersLogoWhite

0

Is function always return a value?

Updated: 8/9/2023
User Avatar

Wiki User

12y ago

Best Answer

no, every function can not return a value. for example

void name()

{

cout<<"Hello world";

}

this function does not return any value due to the key word void that tells the compiler that the function does not returns a value.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

No.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is function always return a value?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is return value 1?

Return value 1 from a function is a true value and generally means success. Return value 1 from the outermost function, i.e. to the shell, however, is a failure indication, and the value is dependent on the design of the code. In other words: context-dependent, always consult the documentation.


How do you return a value in a PHP function?

Below is a simple example of how you could return a value in a PHP function. &lt;?php function returnme($value) { return $value; } echo returnme('hello'); // outputs: hello ?&gt;


What part of a function definition specifies the data type of the value that the function returns?

The function header. The return value is written before the name of the function. This return type must match the type of the value returned in a return statement.


What statement returns a value from a function?

return


How do you echo the return value of a function?

echo function();


What is a return statement used for?

It means end the function. Functions automatically end when execution reaches the end of the function, but you can return from a function at any point within the function with a return statement. If the function returns a value to its caller, you must provide a reachable return statement along with the value you wish to return.


Where do you use no argument no return in c function?

Where there is no need to return any type of value from a function


Can you use printf as a return value?

No, it is a function. But printf does return a value: the number of characters it has written.


What is return in programming?

The return statement is used in functions to return control to the caller. If the function is declared non-void, the return statement also allows the programmer to return a value to the caller.


What number will the function return if the value of 24?

It depends on the function in question.


When a function does not return a value what kind of function is it called?

In most computer languages, a procedure that returns a value is called a function and a procedure that does not return a value is called a subroutine or subprogram. Usually the languages treat the passing of arguments/parameters differently between functions and subroutines. The C language does not distinguish between them. A subroutine that does not return a value is define as a "void" function indicating that no return value is used or available.


What does a void method do?

In Java, this keyword is used to specify that the method has no return value.