Science, asked by qwertyqwer5011, 10 months ago

If function is not returning any values we use ____ as return type??

Answers

Answered by ridhimakh1219
1

If function is not returning any values we use void as return type.

Explanation:

Void return type

Void in computer programming language is specified as function return type, it means that function will not return any value.

After completing the desired task, void function will return control back to the caller.

It is written as stand-alone statement.  

For example, a function displaying a message without returning any value.

Program in C++

void display( )  // fxn definition

{

cout << "Hello World!!!!";

}

void main ( )

{

display( );  // fxn call

}

Answered by Anonymous
0

If a function is not returning any values, then we use void as the return type.

  • Void functions do not return a value after the function executes but they are used similarly like value-returning functions.
  • It completes its task and then returns control to the caller.
  • When the keyword void is used in a pointer declaration, it means that the pointer is universal.
  • On the other hand, when it is used in a function's parameter list, it indicates that the function has no parameters.

Similar questions