hey couldnt go over 1000 words, i have 2 more questions............
3:Assume the int variables i and result , have been declared but not initialized. Write a for loop header -- i.e. something of the form
for ( . . . )
for the following loop body:
result = result * i;
When the loop terminates, result should hold the product of the odd numbers between 10 and 20.
NOTE: just write the for loop header; do not write the loop body itself. ...........................................................................................
4:Assume the int variables i , lo , hi , and result have been declared and that lo and hi have been initialized.
Write a for loop that adds the integers between lo and hi (inclusive), and stores the result in result .
Your code should not change the values of lo and hi . Also, do not declare any additional variables -- use only i , lo , hi , and result .
2007-02-15
14:12:56
·
2 answers
·
asked by
Alex P
2