Skip to content

Commit 0da5b38

Browse files
Merge branch 'main' into feat/programs-palindrome-number
2 parents ae5b3b1 + 14f39c1 commit 0da5b38

File tree

13 files changed

+504
-128
lines changed

13 files changed

+504
-128
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ contact_links:
44
url: https://javaistic.vercel.app/
55
- name: Blog
66
about: Check out the Javaistic Official Blog.
7-
url: https://blog-javaistic.vercel.app/
7+
url: https://javaistic.vercel.app/blog
88
- name: Changelog
99
about: Check out the Javaistic detailed changelog.
1010
url: https://javaistic.vercel.app/changelog

content/programs/java-program-to-check-armstrong-number.mdx

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -217,84 +217,6 @@ Armstrong numbers between 1 and 10000:
217217
Total Armstrong numbers found: 15
218218
```
219219

220-
## 4) Interactive Program
221-
222-
A complete program with user input and detailed output.
223-
224-
### Example
225-
226-
```java
227-
import java.util.Scanner;
228-
229-
class Main {
230-
public static void main(String[] args) {
231-
Scanner scanner = new Scanner(System.in);
232-
233-
System.out.print("Enter a number to check: ");
234-
int num = scanner.nextInt();
235-
236-
int digits = countDigits(num);
237-
System.out.println("\nAnalyzing " + num + " (has " + digits + " digits):");
238-
239-
// Show step-by-step calculation
240-
int original = num;
241-
int sum = 0;
242-
String calculation = "";
243-
244-
while (num > 0) {
245-
int digit = num % 10;
246-
int digitPower = power(digit, digits);
247-
sum += digitPower;
248-
249-
if (!calculation.isEmpty()) {
250-
calculation = " + " + calculation;
251-
}
252-
calculation = digit + "^" + digits + "(" + digitPower + ")" + calculation;
253-
254-
num /= 10;
255-
}
256-
257-
System.out.println("Calculation: " + calculation + " = " + sum);
258-
259-
if (original == sum) {
260-
System.out.println("Result: " + original + " is an Armstrong number! ✓");
261-
} else {
262-
System.out.println("Result: " + original + " is not an Armstrong number. ✗");
263-
}
264-
265-
scanner.close();
266-
}
267-
268-
static int power(int base, int exp) {
269-
int result = 1;
270-
for (int i = 0; i < exp; i++) {
271-
result *= base;
272-
}
273-
return result;
274-
}
275-
276-
static int countDigits(int num) {
277-
if (num == 0) return 1;
278-
int count = 0;
279-
while (num > 0) {
280-
count++;
281-
num /= 10;
282-
}
283-
return count;
284-
}
285-
}
286-
```
287-
288-
#### Sample Output
289-
290-
```plaintext
291-
Enter a number to check: 371
292-
293-
Analyzing 371 (has 3 digits):
294-
Calculation: 3^3(27) + 7^3(343) + 1^3(1) = 371
295-
Result: 371 is an Armstrong number! ✓
296-
```
297-
298220
---
299221

300222
### Notes & Tips

src/app/(site)/about/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ export default function AboutPage() {
142142
>
143143
Our platform bridges complex Java concepts with real-world
144144
application through interactive tutorials, hands-on exercises, and
145-
structured learning paths. Whether you&apos;re a complete beginner or
146-
experienced developer, our community-driven approach ensures
145+
structured learning paths. Whether you&apos;re a complete beginner
146+
or experienced developer, our community-driven approach ensures
147147
accessible, practical learning for everyone.
148148
</motion.p>
149149
</div>

0 commit comments

Comments
 (0)