C Programming - Functions - Discussion

Discussion Forum : Functions - True / False Questions (Q.No. 3)
3.
If return type for a function is not specified, it defaults to int
True
False
Answer: Option
Explanation:

True, The default return type for a function is int.

Discussion:
9 comments Page 1 of 1.

Mahima Awasthi said:   5 years ago
In C the default return type is void. It's int in C++.

Venkat said:   5 years ago
The default return type is int.

OS will collect the default integer value that is 0.
According to me, that is programmer choice, but compiler default will return an integer.

Dipali said:   6 years ago
The default return type is void.

Pr@dnya said:   7 years ago
The int is the main () function's return type. That means that the kind of value main () can return is an integer.

Void main () is not a standard form, some compilers allow this, but none of the standards have ever listed it as an option. Therefore, compilers don't have to accept this form and several don't. Again, stick to the standard form, and you won't run into problems if you move a program from one compiler to another.

B P Rao said:   7 years ago
Yes you can declare.

Rishikesh said:   8 years ago
Can I declare function float yes/no?

Aman said:   9 years ago
The given answer (i.e., True) corresponds to the pre C99 era. It is no longer valid.

Jitendra said:   9 years ago
Please specify a code in which there is a function called with no return type.

Sparsh said:   1 decade ago
But everytime you declare function you have to specify that it is void, int or float.

How it can be int ?

Post your comments here:

Your comments will be displayed after verification.