Thread: arrays proplem
View Single Post
Dec 29th, 2007
0

Re: arrays proplem

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.

C++ Syntax (Toggle Plain Text)
  1. for(int i =0; i<25; i++) {
  2. alpha[i] = i * i;
  3. alpha[49-i] = (49-i) * 3;
  4. }
Reputation Points: 350
Solved Threads: 63
Posting Pro
invisal is offline Offline
562 posts
since Mar 2005