Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Correct output for this program?

 
Matt Kidd
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. You could have found this out by running the program yourself!
 
Matt Kidd
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mental note....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic