Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   help for simple output:- (http://www.go4expert.com/forums/help-simple-output-t15472/)

skp819 12Dec2008 11:36

help for simple output:-
 
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................

shabbir 12Dec2008 12:04

Re: help for simple output:-
 
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");
}


skp819 12Dec2008 12:10

Re: help for simple output:-
 
oh thanks
I found the solution

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


All times are GMT +5.5. The time now is 17:14.