answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: If a function does not have return type it is declared as?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Is return type can also be used in a function with return type void?

no


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.


How many types of function in C?

Well, it depends on what you mean by the type of a function. There are user defined functions and library functions.


What should a function include?

A function must include an interface and an implementation. In some programming languages the two may be declared separately, particularly if the language is declarative. The interface typically consists of the function's return type followed by the function name and the type of its arguments, if any, usually enclosed in parenthesis (often round brackets). In untyped languages, the return type and the type of arguments may be optional, but the arguments must be formally named while the return value usually has the same name as the function. In typed languages the types must be specified but the names are optional unless the interface and implementation are combined. In typed languages that support function overloading, the function name and the number and type of the arguments form the function's unambiguous signature. The signature also includes the constness of the function and its arguments where supported, but does not include the return type nor any argument default values that may be provided. The function's implementation must duplicate the interface (if declared separately) but must also formally name the arguments. The function body is usually parenthesised (often in curly braces).


What is return means in programming?

A return statement exits the function in which it is declared and gives control to the calling code. Returning from the main function exits the program and gives control to the execution environment.

Related questions

What is the return type of calloc function?

the return type is void


Is return type can also be used in a function with return type void?

no


What is the function that eliminates the need to place the function definition before all calls to the function?

A forward declaration. In all statically typed languages (such as C++), all types must be declared before they can be used. A function is a type (the return value defines its type), but the compiler only needs to know how the function is called, not how it is implemented, so the function definition does not need to be visible to the compiler before the function can be called. The definition can actually be placed in another translation unit entirely. Note that a function definition is also a function declaration. Forward declarations make it possible for two functions to be dependent upon each other. A function declaration includes the return type, the name of the function and its argument types. The formal names of a function's arguments are not required in it's declaration, they are only required in its definition. A function's signature is the same as its declaration but excludes the return type. All calls to a function must match its signature. If the return type is used, it must be assigned to a type that is covariant with the declared type. Function declarations are typically placed in header files. By including the header in every translation unit that uses the function, we ensure the function's declaration is consistent across all translation units. If the function is defined in the same header it is declared, then it must also be declared inline. Multiple definitions of the same function are permitted provided they are token-for-token identical, thereby adhering to the one definition rule (ODR).


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.


How many types of function in C?

Well, it depends on what you mean by the type of a function. There are user defined functions and library functions.


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


What should a function include?

A function must include an interface and an implementation. In some programming languages the two may be declared separately, particularly if the language is declarative. The interface typically consists of the function's return type followed by the function name and the type of its arguments, if any, usually enclosed in parenthesis (often round brackets). In untyped languages, the return type and the type of arguments may be optional, but the arguments must be formally named while the return value usually has the same name as the function. In typed languages the types must be specified but the names are optional unless the interface and implementation are combined. In typed languages that support function overloading, the function name and the number and type of the arguments form the function's unambiguous signature. The signature also includes the constness of the function and its arguments where supported, but does not include the return type nor any argument default values that may be provided. The function's implementation must duplicate the interface (if declared separately) but must also formally name the arguments. The function body is usually parenthesised (often in curly braces).


What is the difference between return 0 and return -1 in c?

If we consider any function that is not the main function that is declared as "bool" i.e it will return boolean values to the main function-0 & 1, meaning 'false' and 'true' respectively. If we have to tell the main function that the condition checked in the function is false or disagreed, then we return 0 to the main function and when we have to tell that the condition checked in the main function is true or agreed, then we return 1 to the main function.


What is return means in programming?

A return statement exits the function in which it is declared and gives control to the calling code. Returning from the main function exits the program and gives control to the execution environment.


When is a function executed and where should a function prototype and function definition appear in a source program?

If you want to use prototype it has to be declared before main(). If you have a function of type double with one argument of type int (with name arg), and the function name is func, then we have:#include ...double func(int arg);...int main(...){...return 0;}...double func(int arg){...}


What is a basic structure of a c programming?

Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...) Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...)


Why is return statement not necessary when function is called by reference?

return is not necessary if the return type is void, and you want to leave the function only at its end.