Write a program in C++ to make such a pattern like the right angle triangle with a number that will repeat a number in a row using the class objects in object-oriented programming.

#include<iostream>
using namespace std;
class first
{
protected :
int i,j,n,r;
public :
int pat()
{
cout<<"Enter no of rows : ";
cin>>n;
for(i=1 ; i<=n ; i++)
{
for(j=1 ; j<=i ; j++)
{
cout<<i;
}
cout<<endl;
}
}
};
int main()
{
first a;
a.pat();
}