CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 10:37:51 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=b886d572dbe2a2a24fada822c59052ae8580cd4870222ecf5f51d3132da8c546a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22j9kn2wpsXT0xVuabDbCHLLJh-cg2eBkx%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cdb97ceba4165e-BLR
Project Euler, Problem #6, C - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Find the difference between the sum of the squares of the first one
- hundred natural numbers and the square of the sum. */
- /* Solution #1 */
- #include <stdio.h>
- int main()
- {
- int i;
- int natNumSum = 0, squareNumSum = 0;
- for(i = 1; i < 101; i++)
- natNumSum += i;
- for(i = 1; i < 101; i++)
- squareNumSum += i * i;
- printf("%d\n", natNumSum * natNumSum - squareNumSum);
- return(0);
- }
- /* 25164150 */
- /* Solution #2 */
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int i;
- double natNumSum = 0;
- double squareNumSum = 0;
- for(i = 1; i < 101; i++)
- natNumSum += i;
- for(i = 1; i < 101; i++)
- squareNumSum += pow(i, 2);
- printf("%.0f\n", pow(natNumSum, 2) - squareNumSum);
- return(0);
- }
- /* 25164150 */
Add Comment
Please, Sign In to add comment
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 2 sec ago | 0.24 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 11 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ✅ NEVER SEEN...
JavaScript | 21 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 33 sec ago | 0.24 KB
-
✅⭐ Make $2500 in 15 minutes ✅ NEVER SEEN BEFO...
JavaScript | 45 sec ago | 0.24 KB
-
⭐⭐⭐ G2A Payment Exploit ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 57 sec ago | 0.24 KB
-
⭐✅ MAKE $2500 IN 15 MIN ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 1 min ago | 0.24 KB
-
⭐ ✅ Free Products Method ✅ ✅ NEVER SEEN BEFOR...
JavaScript | 1 min ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand