Posted By

cmm7825 on 05/20/10


Tagged


Versions (?)

Problem 6


 / Published in: Ruby
 

  1. #! /usr/bin/ruby
  2.  
  3. sum = 0
  4. square = 0
  5. for i in 1..100
  6. sum += i
  7. square += i*i
  8. end
  9. sum = sum*sum
  10.  
  11. puts sum-square

Report this snippet  

You need to login to post a comment.