Write a program of function with parameter and return value


 

/* Write a program of  function with  parameter and return value. */

#include<iostream.h>

#include<conio.h>

int main()

{

int a,b,c;

clrscr();

int max(int,int);

cout<<“enter two numbers”;

cin>>a>>b;

c=max(a,b);

cout<<“greatest=”<<c;

getch();

return(0);

}

int max(int x,int y)

{

if(x>y)

return(x);

else

return(y);

}

output:

enter two number 10 20

20

Related Posts

Comments are closed.