English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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 in Computers & Internet Programming & Design

2 answers

I don't see a question here at all.

If you need programming done I charge a flat rate of $65 an hour and I accept paypal.

2007-02-15 14:21:37 · answer #1 · answered by D 4 · 0 1

Here it is:

3.


for(i=11,result=0;i<=20;i+=2)
{
result*=i;
}

4.

for(i=lo+1,result=0;i {
result+=i;
}

OM NAMAH SHIVAY

2007-02-16 11:56:55 · answer #2 · answered by Gurudev 3 · 0 0

fedest.com, questions and answers