Function Argument:
-The value which is pass in the function at the time of the function calling is called as function argument.
-We need to store that argument in some function variable.
Syntax-
return_type function(arguments)
{
return;
}
program-
#include< stdio.h>
void func(int a, char ch)
{
printf("Number is=%d\n",a);
printf("Character is=%c\n",ch);
}
int main()
{
char a;
func(4,'A');
func(6,'B');
return 0;
}
output-
Number is=4
Character is=A
Number is=6
Character is=B
-In this program, we pass two arguments in the func() function which will print the both value.
-Here first argument is the integer and other argument is the character.
-func(value1,value2), this is the way to pass the value in function.