201. Write a program to access the private data of parent class by its child class?

#include<iostream.h> #include<conio.h> class parent {                 int a,b; public:                 parent()                                 {                                 a=10;                                 b=20;                                 } }; class child:public parent { public:                 int c;                 child()                                 {                                 c=30;                                 } }; void main() {                 clrscr();                 int *ptr;                 child obj;                 ptr=&obj.c;                 cout<<"The Address of C... Continue Reading →

Advertisements

200. Write a program to demonstrate abstract class?

#include<iostream.h> #include<conio.h> int p=1000,t=1; class bank { public:                 virtual void interest()=0;               //Pure Virtual Function }; void bank::interest() {                 cout<<"The Home Loan : "; } class sbi:public bank {                 int i; public:                 void interest()                                 {                                 i=(p*5*t)/100;                                 cout<<"SBI Interest Is : "<<i<<endl;                                 } }; class pnb:public bank {                ... Continue Reading →

Cartesian product: –

Cartesian product: - In many cases, user may require to retrieve data from multiple table. Suppose we want to retrieve employee name, salary and living city then we have to get data from tables employee and company. Cartesian product is useful in SQL to retrieved data from multiple table. We can use Cartesian product in... Continue Reading →

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: