write a program for function overloading?
Answer Posted / abhinav kr
#include<iostream.h>
#include<conio.h>
void printline();
void printline(char ch);
void printline(char ch,int n);
void main()
{
printline();
printline('$');
printline('$',5);
}
void printline()
{
clrscr();
for(int i=1;i<=5;i++)
cout<<"*"<<endl;
}
void printline (char ch)
{
for(int i=1;i<=5;i++)
cout<<ch<<endl;}
void printline(char ch,int n)
{
for(int i=1;i<=n;i++)
cout<<ch<<endl;
getch();
}
| Is This Answer Correct ? | 12 Yes | 2 No |
Post New Answer View All Answers
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What is the difference between a constructor and a destructor?
Why is oop useful?
Why do we use polymorphism in oops?
Prepare me a program for the animation of train
What is encapsulation example?
How is class defined?
why reinterpret cast is considered dangerous?
When not to use object oriented programming?
What is the difference between inheritance and polymorphism?
What are the three parts of a simple empty class?
What is object-oriented programming? Webopedia definition
i got a backdoor offer in process global,Bangalore..Can i work with it?
Which language is pure oop?
Whats oop mean?