This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Correct output for this program? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Correct output for this program?" Watch "Correct output for this program?" New topic
Author

Correct output for this program?

Matt Kidd
Ranch Hand

Joined: Jul 17, 2002
Posts: 256
This is the program:

This is the output I came up with:
1
4
9
16
25
36
49
64
81
100
Total is 385
Am I correct?
[ August 08, 2002: Message edited by: Matt Kidd ]
Chad McGowan
Ranch Hand

Joined: May 10, 2001
Posts: 265
You are correct. You could have found this out by running the program yourself!
Matt Kidd
Ranch Hand

Joined: Jul 17, 2002
Posts: 256
mental note....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Correct output for this program?
 
Similar Threads
Runtime behavior after command-line invocation
synchronized run()
value of x?
how to compare the values in arrays
Int By Reference passing..