C++ program – illustrate Multilevel Inheritance

by Nideesh C on April 14, 2011 · 0 comments

in C++




A program to illustrate multilevel inheritance. we have three classes, student, test and result. Here class student is the base class. And the class test is derived from the base class student. And the another class result is derived from the class test.

PROGRAM

#include
#include
class student
{
   		protected:
   		int rno;
   		public:
   		void getno(int);
   		void putno(void);
};
void student::getno(int a)
{
rno=a;
}
void student ::putno()
{
cout<<"rollno="<<<<"marks in sub1="<<<<"marks in sub2="<<<<"total="<<

OUTPUT
Roll number:111
Marks in sub1=75
Marks in sub2=59.5
Total=134.5

Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. C++ program – illustrate Hybrid Inheritance.
  2. C++ program – Using class to generate mark sheet using multiple inheritance
  3. C++ program – illustrate the static member function
  4. C++ class program – illestrate File operations
  5. C++ program – implement three classes using multiple inheritance

Leave a Comment

Previous post:

Next post: