CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 15:50:21 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=1da8fbbf7b657f6070dbd22e510fd6d5f139dadcba5b01b743816b1503e96871a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22pj8PGfCdUauoJuQ8UkfyqCMw1Dt1fI9k%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cf833d4e8e7fa8-BLR
Project Euler, Problem #4, C - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- /* The task. A palindromic number reads the same both ways. The
- * largest palindrome made from the product of two 2-digit numbers is
- * 9009 = 91 × 99. Find the largest palindrome made from the product
- * of two 3-digit numbers. */
- int reverse(int number);
- int main()
- {
- int i, j, product;
- int accumulator = 0;
- for(i = 999; i > 99; i--)
- for(j = 999; j > 99; j--)
- {
- product = i * j;
- if(product == reverse(product))
- if(accumulator < product)
- accumulator = product;
- }
- printf("The number is %d.\n", accumulator);
- return(0);
- }
- int reverse(int number)
- {
- int divisor = 1, multiplier = 1, output = 0;
- while(number >= divisor * 10)
- divisor *= 10;
- while(number > 0 && divisor > 0)
- {
- if(number >= divisor)
- {
- output += number / divisor * multiplier;
- number = number % divisor;
- }
- multiplier *= 10;
- divisor /= 10;
- }
- return(output);
- }
- /* The number is 906609. */
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Trading Profit Method ✅ NEVER SEEN BEFORE...
JavaScript | 6 sec ago | 0.24 KB
-
⭐⭐⭐GMAIL Logs (2FA disabled)⭐⭐
Java | 8 sec ago | 0.10 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 15 sec ago | 0.24 KB
-
⭐⭐⭐MAKE $900 INSTANTLY⭐⭐
Java | 20 sec ago | 0.10 KB
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 25 sec ago | 0.24 KB
-
⭐⭐⭐Make $1500 in 20 minutes⭐⭐
Java | 33 sec ago | 0.10 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 34 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ✅ NEVER SEEN...
JavaScript | 44 sec 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