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 is New modifiers?
Describe static function with its usage?
What does %d do in c?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
The statement, int(*x[]) () what does in indicate?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
Explain function pointer with exapmles.
Describe the order of precedence with regards to operators in C.
What is a keyword?
Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Quick Sort 2) Bubble Sort 3) Merge Sort
Do you know the difference between exit() and _exit() function in c?