Implicit return type int in C

CServer Side ProgrammingProgramming

If some function has no return type, then the return type will be int implicitly. If return type is not present, then it will not generate any error. However, C99 version does not allow return type to be omitted even if it is int.

Example

#include<stdio.h>
my_function(int x) {
   return x * 2;
}
main(void) {
   printf("Value is: %d", my_function(10));
}

Output

Value is: 20
raja
Published on 03-May-2019 07:28:15
Advertisements