Thread: arrays proplem
View Single Post
Join Date: Mar 2005
Posts: 464
Reputation: invisal is a jewel in the rough invisal is a jewel in the rough invisal is a jewel in the rough 
Solved Threads: 49
invisal's Avatar
invisal invisal is offline Offline
Posting Pro in Training

Re: arrays proplem

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

  1. for(int i =0; i<25; i++) {
  2. alpha[i] = i * i;
  3. alpha[49-i] = (49-i) * 3;
  4. }
Yesterday is a history, tomorrow is a mystery, today is a gift.
Behind every smile is a tear.
Visal .In
Reply With Quote