You are on page 1of 3

Program:

#include<iostream>

using namespace std;

int main()

{int r;

cout<<"enter no. of rows"<<endl;

cin>>r;

for(int i=0;i<=r;i++)

{for (int j=1;j<=i;j++)

{cout<<"*"<<r;}

cout<<endl;

return 0;

Screenshoot of output:
DD

Design:

#include<iostream>

using namespace std;

int main()

{int r;

char ('*');

cout<<"enter no. of rows"<<endl;

cin>>r;

for(int i=0;i<=r;i++)

{for (int j=1;j<=i;j++)

{cout<<i;}

cout<<endl;}

return 0;

Screenshot of output:

You might also like