Vidyalelo
C Programming · Q6

C Fundamentals

Programming · C Programming · question 6

Q6

What is the default return type of a function in C if not specified?

A.
int
Answer
B.
void
C.
char
D.
float

Answer: Option A

Solution

Answer: Option A
Solution:
The default return type of a function in C if not specified is Option A: 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: int

For 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.