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 is basic concept of oop?
What are the types of abstraction?
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?
what is graphics
Why do we use oop?
write knight tour problem which is present in datastructure
What is abstraction in oop with example?
What are the components of marker interface?
What is the highest level of cohesion?
What is class and example?
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.
How can you overcome the diamond problem in inheritance?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
Why is there no multiple inheritance?
Can bst contain duplicates?