MultiLevel Inheritance C++ program to print mirrored right triangle star pattern
Write a C++ program to print mirrored right triangle star pattern series using Multi-Level Inheritance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #include<iostream> using namespace std; class T4Tutorials_Parent1 { protected : int i; }; class pat2:public T4Tutorials_Parent1 { protected : int j; }; class pat:public pat2 { protected : int r; public : int patern() { cout<<"input No of rows : "; cin>>r; for(j=1 ; j<=r ; j++) { for(i=j ; i<r ; i++) { cout<<" "; } for(i=1 ; i<=j ; i++) { cout<<"*"; } cout<<"\n"; } } }; int main() { pat a; a.patern(); } |
FAQ
How to print right triangle star pattern series with trailing spaces of n rows using for loop in C++ using Multi-Level Inheritance.
Logic to print mirrored right triangle star pattern series in C programming using Multi-Level Inheritance.