source file name: funov5.CPP
#include <iostream.h>
#include <conio.h>
// function with 2 parameters
void disp(int a, float b) {
cout << "Integer number: " << a;
cout << " and float number: " << b << endl;
}
// function with double type single parameter
void disp(double d) {
cout << "Double number: " << d << endl;
}
// function with int type single parameter
void disp(int a) {
cout << "Integer number: " << a << endl;
}
int main() {
int a = 50;
double b = 123.45;
float c=48.87f;
clrscr();
// call function with int type parameter
disp(a);
// call function with double type parameter
disp(b);
// call function with 2 parameters
disp(a, c);
return 0;
}
output:
0 Comments
Post a Comment