//P-12: Function overloading
#include <iostream.h>
#include <conio.h>
void show()
{
cout << "Function show() without argument" << endl;
}
void show(int a)
{
cout << "\nFunction show() with one argument" << endl;
cout << "Number : " << a << endl;
}
void show(int n, char nm[])
{
cout << "\nFunction show with two argument" << endl;
cout << "Number : " << n << endl;
cout << "String : " << nm << endl;
}
void main()
{
clrscr();
show();
show(65);
show(36,"Welcome to function overloading");
getch();
}
Comments
Post a Comment