Wap in cpp to print following pattern using for loop 1 11 111 1111 11111

Wap in cpp to print following pattern using for loop
1
11
111
1111
11111

#include<iostream.h>
#include<conio.h>
void main()
{ int i,j;
for(i=1;i<=5;i++)
{

for(j=1;j<=i; j++)
{ cout<<”1”; }
}
getch();
}

1 comment:

If You Like The Post Or want to Add Something More
then feel free to comment