Permalink
Browse files

jumped to prob6, it was easier

  • Loading branch information...
1 parent f3dcc2f commit 949f9fc4e452dced8f75dedff57a332eac0c2a18 @WhimsicalBox committed Aug 30, 2011
Showing with 24 additions and 0 deletions.
  1. +24 −0 prob6.cpp
View
@@ -0,0 +1,24 @@
+#include <iostream>
+
+using namespace std;
+
+int main()
+{
+ int count = 0;
+ unsigned long sumofsquare = 0;
+ unsigned long squareofsum = 0;
+ unsigned long difference = 0;
+
+ while (count <= 100)
+ {
+ sumofsquare = sumofsquare + (count * count);
+ squareofsum = squareofsum + count;
+ count++;
+ }
+ squareofsum = squareofsum * squareofsum;
+ difference = squareofsum - sumofsquare;
+
+ cout << difference << endl;
+
+ return 0;
+}

0 comments on commit 949f9fc

Please sign in to comment.