Saturday, 28 December 2013

C++ Program to find area of square and rectangle using function overloading


#include<iostream.h>
int area(int);
int area(int ,int );
void main()
{
  cout<<area(10);
  cout<<area(5,2);
}
int  area (int  l)
{
  return(l*l);
}
int area (int l,int b)
{
  return(l*b);
}

No comments:

Post a Comment