Monday 26 April 2021

Function Parameter Matching and Overloading Qus - 8

 #include<iostream.h>

#include<conio.h>

void show(float a)

{

cout<<"float - "<<a<<endl;

}

void show(double a)

{

cout<<"double - "<<a<<endl;

}

int main()

{

clrscr();

//show(5);     //coversion - abmiguity(float,double)

//show('k');  // ""

show(6.7);  //double

show((float)6.7);

show((double)5);

show((float)5);

float f=8.5;

show(f);

double f1=9.6;

show(f1);

//show();      //No Match - Error

getch();

return 0;


}

No comments:

Post a Comment