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
What are the benefits of oop?
What is an advantage of polymorphism?
What is encapsulation example?
Where You Can Use Interface in your Project
How is polymorphism achieved?
What do you mean by abstraction?
Please send ford technologies placement paper 2 my mail id
write a program that takes input in digits and display the result in words from 1 to 1000
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
Why is polymorphism needed?
is there any choice in opting subjects like 4 out of 7
how to get the oracle certification? send me the answer
What is interface in oop?
What is purpose of inheritance?