Inline member functions

6.     Write an object-oriented program in C++ to generate the following series of numbers using constructor, destructor and inline member functions.

(i)                                                                                                                                                (ii)

1                                         1

2 1               1 2        
3 2 1             1 2 3    
4 3 2 1           1 2 3 4  
5 4 3 2 1         1 2 3 4 5
6 5 4 3 2 1       1 2 3 4 5 6    
7 6 5 4 3 2 1     1 2 3 4 5 6 7  
8 7 6 5 4 3 2 1   1 2 3 4 5 6 7 8
9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9

(iii)                                                                                             (iv)

9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9
8 7 6 5 4 3 2 1   1 2 3 4 5 6 7 8
7 6 5 4 3 2 1     1 2 3 4 5 6 7  
6 5 4 3 2 1       1 2 3 4 5 6    
5 4 3 2 1         1 2 3 4 5      
4 3 2 1           1 2 3 4        
3 2 1             1 2 3          
2 1               1 2            
1                 1              
WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X