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 polymorphism and example?
Why polymorphism is used in oops?
Which method cannot be overridden?
What is a superclass in oop?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
Can a varargs method be overloaded?
What is difference between class and object with example?
Why multiple inheritance is not possible?
What is polymorphism what are the different types of polymorphism?
What is class encapsulation?
What is use of overloading?
What is protected in oop?
What is encapsulation in simple terms?
What is encapsulation in oops?
Get me a number puzzle game-program