How this can be done
if the number of generating " myArray[i]" for many times depends on a number entered by the user.
for example:.
if the user enter 3
- the program will generate it something like the following
myArray[i] + myArray[i+1] + myArray[i+2] // (1)
else if the user enter 4
the following will be generated
myArray[i] + myArray[i+1] + myArray[i+2] + myArray[i+3] // (2)
i need to use the result of (1) or (2) in another "for loop", as
for(int i =0;i<10;i++)
{
// the problem how to get the following from the previous (1) or (2)
// to make " i " used by the second for loop
myArray[i] + myArray[i+1] + myArray[i+2]
}
S_Kiryazov143 reputationPosted Oct 16, 2004, 7:24 AM EDT
saudyonline16 reputationPosted Oct 17, 2004, 12:34 AM EDT
saudyonline16 reputationPosted Oct 18, 2004, 4:28 AM EDT
bilnaadRank #2,169 · 655 reputationPosted Oct 18, 2004, 4:39 AM EDT
saudyonline16 reputationPosted Oct 20, 2004, 3:08 AM EDT
Carlos SanchezRank #6,113 · 276 reputationPosted Oct 20, 2004, 5:57 AM EDT
saudyonline16 reputationPosted Oct 22, 2004, 1:09 PM EDT
bilnaadRank #2,169 · 655 reputationPosted Oct 22, 2004, 3:43 PM EDT
saudyonline16 reputationPosted Oct 23, 2004, 2:51 AM EDT
saudyonline16 reputationPosted Oct 23, 2004, 3:13 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts