simple program for virtual function?
Answer / shafi . shaik
//The Concepts of interface classes in Java (Function
Overriding
#include<iostream.h>
#include<conio.h>
class A
{
public:
virtual void cal()
{
}
};
class B:public A
{
public:
void cal()
{
cout<<"Addition"<<10+20;
}
};
class C:public A
{
public:
void cal()
{
cout<<"Multiplication"<<10*20;
}
};
void main()
{
clrscr();
A *p;
B ob;
C ob1;
p=&ob;
p->cal();
p=&ob1;
p->cal();
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
What are the advantages and disadvantages of c language?
How can I run c program?
Do you know the use of 'auto' keyword?
increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {
Why is event driven programming or procedural programming, better within specific scenario?
If you know then define #pragma?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
0 Answers College School Exams Tests,
List out few of the applications that make use of Multilinked Structures?
What is scope rule in c?
Explain can static variables be declared in a header file?
write a program to find the largest and second largest integer from an array
program to get the remainder and quotant of given two numbers with out using % and / operators?
10 Answers College School Exams Tests, IBM,