RSS Forums RSS

Re: arrays proplem

Please support our C++ advertiser: Programming Forums

arrays proplem

Posts: 419
Reputation: invisal will become famous soon enough invisal will become famous soon enough 
Solved Threads: 39
invisal's Avatar
invisal invisal is offline Offline
Posting Pro in Training

Re: arrays proplem

  #8  
Dec 29th, 2007
Originally Posted by superjacent View Post
You're on the right track. Another solution would be to use only one for loop and use an if else test condition to test for the first 25, do whatever...

If you want to use only one loop, you don't need to use condition.

for(int i =0; i<25; i++) {
   alpha[i] = i * i;
   alpha[49-i] = (49-i) * 3;
}
Yesterday is a history, tomorrow is a mystery, today is a gift.
Behind every smile is a tear.
Visal .In
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:30 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC