Wednesday, 28 September 2016

WAP for bigger out of two using functions

WAP for bigger out of two using functions.

//calculate the bigger out of two given no's using function.

#include<iostream.h>
using namespace std;
void main( )
{
int big(int,int);             //function declaration.
int x,y;
cout<<"enter two numbers:";
cin>>x>>y;
max=big(x,y);                            //function call.
cout<<"Bigger Number="<<max;
}
int big(int a,int b)                                    //function definition.
{
if(a>b)
return(a);
else
return(b);
}

0 comments: