Saturday, August 14, 2010

Function Overloading

,
#include<iostream.h>
#include<conio.h>
Int sqr  (int);
Float sqr (float);
Main ()
{
Clrscr ();
Int a= 15;
Float b = 2.5;
Cout <<”Square =”<<<”/n”;
Cout <<”Square =”<<<”/n”;
Return 0;
}
Int sqr (int s)
{
Return (s*s);
}
Float sqr (float j)
{
Return (j*j);
}

OUTPUT

Square = 225
Square = 6.25

0 comments to “Function Overloading”

Post a Comment