Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board
Go4Expert
Go4Expert RSS Feed

Go Back   Programming and SEO Forum >  Go4Expert > Queries and Discussion > Programming > C-C++

Reply  Copy HTML to Clipboard  Copy BBCode to Clipboard  | More
 
Bookmarks Thread Tools Search this Thread Display Modes
Old 12-12-2008, 10:36 AM   #1
Contributor
 
Join Date: Dec 2008
Posts: 89
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
skp819 is on a distinguished road

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................

Last edited by skp819; 12-12-2008 at 11:05 AM..
skp819 is offline   Reply With Quote
Old 12-12-2008, 11:04 AM   #2
Go4Expert Founder
 
shabbir's Avatar
 
Join Date: Jul 2004
Location: On Earth
Posts: 12,750
Thanks: 131
Thanked 294 Times in 228 Posts
Rep Power: 10
shabbir has much to be proud ofshabbir has much to be proud ofshabbir has much to be proud ofshabbir has much to be proud ofshabbir has much to be proud ofshabbir has much to be proud ofshabbir has much to be proud ofshabbir has much to be proud of
Send a message via Yahoo to shabbir

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");
}
shabbir is offline   Reply With Quote
Old 12-12-2008, 11:10 AM   #3
Contributor
 
Join Date: Dec 2008
Posts: 89
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
skp819 is on a distinguished road

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";
}
skp819 is offline   Reply With Quote
Reply  Copy HTML to Clipboard  Copy BBCode to Clipboard  | More


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Bookmarks

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

 

All times are GMT +5.5. The time now is 04:01 PM.