help for simple output:-

skp819's Avatar
Contributor
hello, I am harish kumar,
I feel helpless for a simple program. please help me to create a program for the below output.
thanks in advance.


* 1
** 22
*** 333
**** 4444
***** 55555
please help................

Last edited by skp819; 12Dec2008 at 12:05..
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
simple here is pseudo code.
Code:
for(i=1;i<=n;i++)
{
  for(j=1;j<=i;j++)
  {
    print("*");
  }
  for(j=1;j<=i;j++)
  {
    print(i);
  }
  print("\n");
}
0
skp819's Avatar
Contributor
oh thanks
I found the solution

for(i=1;i<=5;i++)
{
for(j=1;j<=i;i++)
{
cout<<"*"<<i;
}
cout<<"\n";
}