help for simple output:-

Contributor
12Dec2008,11:36   #1
skp819's Avatar
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..
Go4Expert Founder
12Dec2008,12:04   #2
shabbir's Avatar
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");
}
Contributor
12Dec2008,12:10   #3
skp819's Avatar
oh thanks
I found the solution

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