By | May 15, 2017

Sum of two numbers

This program shows how to add two numbers using the concept single level inheritance.We have made two class.In first class i.e. “base” user will input a number using function “get()” and in second class i.e “scan” which extends the “base” class operation on two numbers will be performed using function “sum()” and result will be displayed using function “display()”. The all three functions will be called by object of “scan” class i.e. “d1”.


sum of two numbers

Leave a Reply

Your email address will not be published. Required fields are marked *