Write the output of the following C++ code. Also, write the name of feature of Object Oriented Programming used in the following program jointly illustrated by the Function 1 to Function 4.
void My_fun ( ) // Function 1
{
for (int I=1 ; I<=50 ; I++) cout<< "-" ;
cout<
}
void My_fun (int N) // Function 2
{
for (int I=1 ; I<=N ; I++) cout<<"*" ;
cout<
}
void My_fun (int A, int B) // Function 3
{
for (int I=1. ;I<=B ;I++) cout <
cout<
}
void My_fun (char T, int N) // Function 4
{
for (int I=1 ; I<=N ; I++) cout<
cout<
}
void main ( )
{
int X=7, Y=4, Z=3;
char C='#' ;
My_fun (C,Y) ;
My_fun (X,Z) ;
}
Answers
Answered by
1
sorry i don't know the answer
debadityadasgupta:
plz dont fool around over here...this is serious
Answered by
2
The output of the following C++ code is ####, 71421. The name of the feature of Object oriented programming used in this program and that is illustrated from function 1 to function 4 is polymorphism or also called as function overloading.
Basically, function overloading happens when two or more functions will have the same name and different parameters. Function overloading is the best example of polymorphism.
Similar questions
Math,
6 months ago
Psychology,
1 year ago
Computer Science,
1 year ago
Chemistry,
1 year ago
Math,
1 year ago