?
What is the default return type of a function in C if not specified?
Answer & Solution
Correct Answer:
Option
A
The default return type of a function in C if not specified is Option A:
So, the correct answer is:
Option A:
For example, if you have a function like this:
The return type is assumed to be
int. In C, if you don't explicitly specify the return type of a function, it is assumed to return an integer (int) by default.So, the correct answer is:
Option A:
intFor example, if you have a function like this:
myFunction() { // Function code}The return type is assumed to be
int, and you can call it as if it returns an integer. If you want a function to return nothing, you explicitly specify Option B: void as the return type.
Join the Discussion
Login to post a comment or share your explanation.
Login