Function Prototyping:
The function prototyping tells the number of arguments,type of arguments and type of the return type to the compiler.The function prototyping is a declaration statement in the calling program.
General Format:
returnType methodName(Argument List);
*Where Argument List specify the type and name of the arguments.
Example:
float Sum(float x,int y);
Or
float Sum(float,int);
Program:
int MAX(int,int); //Function Prototyping
void main()
{
int A,B;
cout<<”Enter the value for A and B”<<endl;
cin>>A>>B;
int R=MAX(A,B);
cout<<”MAX Is:”<<R<<endl;
}
int MAX(int x,int y) //Call by Value
{
if(x>y) return x;
return y;
}
|
|
|

