Single inheritance C++ program to show the sum of an A.P. series

By Prof. Fazal Rehman Shamil
Last modified on April 7th, 2021

Write a c++ program to find out the sum of an A.P. series by using the single inheritance in object-oriented programming.

Single inheritance example with class diagram

single inheritance example with class diagram
single inheritance example with class diagram

 

Output

Input the starting number: 2

Input the number of items: 4

Input the common difference: 6

the Sum of the A.P. series are :

2+8+14+20=44

Prof.Fazal Rehman Shamil (Available for Professional Discussions)
1. Message on Facebook page for discussions,
2. Video lectures on Youtube
3. Email is only for Advertisement/business enquiries.