Welcome Guest | Sign in | Register
Arrays - Discussion Page For Q.10437 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Arrays > Questions and Answers

Q: Use a for loop to total the contents of an integer array called numbers which has five elements. Store the result in an integer called total.
A. Statement 1
for( loop = 0, total = 0; loop >= 4; loop++ )
total = total + numbers[loop];
B. Statement 2
for( loop = 0, total = 0; loop < 5; loop++ )
total = total + numbers[loop];
C. Statement 3
for( loop = 0, total = 0; loop <= 5; loop++ )
total = total + numbers[loop];
D. Cannot be determined

Answer and Explanation

Answer:Statement 2
for( loop = 0, total = 0; loop < 5; loop++ )
total = total + numbers[loop];

Explanation:
There is no explanation...

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.