What is the default return type of a function in C if not specified?
A. int
B. void
C. char
D. float
Answer: Option A
Solution (By Examveda Team)
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:
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. Related Questions on C Fundamentals
What is the primary purpose of a function prototype in C?
A. Declare a variable
B. Declare a function
C. Define a function
D. Assign a value
What is the correct syntax for declaring a variable in C?
A. int variable_name;
B. variable_name = 5;
C. variable_name int;
D. int = variable_name;

Join The Discussion