Differentiate between function declaration and variable declaration
Answers
Answered by
2
HEYA
HERE'S UR ANSWER
MAY IT HELPS U
When we declare the variable we using externkeyword, and decalretion is do outside the main() function.
ex-
extern int a; // extern is work as globle, int is data type and a is variable
but the definition for the variable is we define variable with there data type
ex-
int a; //int is data type and a is variable
function declaration-
return_type function_name();
ex- int sum();
In the declaration we just provide function name,return not write body.
definition of function
here we write the body of fuction what the work.
ex-
int sum(){
c=a+b;
return c;
}
MARK ME BRAINLIEST IF U LIKE IT THEN
HERE'S UR ANSWER
MAY IT HELPS U
When we declare the variable we using externkeyword, and decalretion is do outside the main() function.
ex-
extern int a; // extern is work as globle, int is data type and a is variable
but the definition for the variable is we define variable with there data type
ex-
int a; //int is data type and a is variable
function declaration-
return_type function_name();
ex- int sum();
In the declaration we just provide function name,return not write body.
definition of function
here we write the body of fuction what the work.
ex-
int sum(){
c=a+b;
return c;
}
MARK ME BRAINLIEST IF U LIKE IT THEN
Similar questions