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


Please Help Members By Posting Answers For Below Questions

What is basic concept of oop?

690


What are the types of abstraction?

551


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

1573


what is graphics

2004


Why do we use oop?

596






write knight tour problem which is present in datastructure

2160


What is abstraction in oop with example?

642


What are the components of marker interface?

598


What is the highest level of cohesion?

568


What is class and example?

564


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

6481


How can you overcome the diamond problem in inheritance?

762


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6136


Why is there no multiple inheritance?

562


Can bst contain duplicates?

663