Pass argument in Function in C language by R4R Team

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.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!