0% found this document useful (0 votes)
6 views4 pages

Java Programs for Array Manipulation

Uploaded by

malacet485
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Java Programs for Array Manipulation

Uploaded by

malacet485
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

+Advanced Question

1. Write a program in Java to input n integers into an array. Your program

should:

1. Display all the palindrome numbers present in the array.

2. Count how many palindrome numbers are there.

3. Find and display the smallest palindrome number.

4. Find and display the largest palindrome number.

5. If no palindrome exists, display "No Palindrome Found".

2. Write a program in Java to input n integers into an array. Your program

should:

1. Count how many times each digit (0–9) appears across all numbers in

the array.

2. Display the digit that appears most frequently.

3. If multiple digits have the same highest frequency, display all of them.

3. Count Prime Digits in Each Element

Input n integers into an array. For each element, count how many digits are prime (i.e., 2, 3,

5, 7). Display the number and its prime digit count.

4. Sum of Even-Indexed Elements


Input n integers. Display the sum of elements at even indices (i.e., index 0, 2, 4…).

5. Check for Perfect Numbers

Input n integers. Display all perfect numbers (numbers equal to the sum of their proper

divisors). Example: 6 → 1 + 2 + 3 = 6

6. Count Numbers with All Even Digits

Input n integers. Count how many numbers have only even digits (e.g., 246, 80).

7. Find Numbers with Digit Sum Divisible by 3

Input n integers. Display numbers whose digit sum is divisible by 3.

8. Display Numbers with Repeating Digits

Input n integers. Display numbers that have at least one digit repeated (e.g., 121, 133).

9. Find Numbers with Alternating Even-Odd Digits

Input n integers. Display numbers where digits alternate between even and odd (e.g., 121,

242).

10. Count Numbers with Palindromic Digit Pattern

Input n integers. Display numbers whose digit pattern is a palindrome, even if the number

itself isn’t. Example: 12321 → palindrome pattern.


[Link] Numbers with Increasing Digits

Input n integers. Display numbers where digits are in strictly increasing order (e.g., 123,

4567).

12. Find Numbers with Digit Product > 50Type equation here .

Input n integers. Display numbers whose digit product is greater than 50. Example: 59 →

5×9 = 45 → not displayed; 79 → 7×9 = 63 → displayed.

📝 ICSE Class 10 Computer Applica Type equation here .tions – Mock Board

Paper

Topic: Arrays and Logical Programming Time: 2 hours Max

Marks: 50

🔹 Section A – Short Programs (Each 5 marks)

Q1. Write a program to input n integers into an array and display all

numbers whose digit sum is divisible by 3. Example: 123 → 1+2+3 = 6 →

divisible by 3

Q2. Input n integers into an array. For each number, count how many digits

are prime (2, 3, 5, 7) and display the count. Example: 235 → 3 prime digits

Q3. Input n integers. Display all numbers that have only even digits.

Example: 246, 80, 222

Q4. Input n integers. Display all numbers whose digits are in strictly

increasing order. Example: 123, 4567


Q5. Input n integers. Display all numbers that have at least one digit

repeated. Example: 121, 133

🔹 Section B – Full Programs (Each 10 marks)

Q6. Input n integers into an array. Display all palindrome numbers, count

them, and print the largest palindrome. If no palindrome exists, display

"No Palindrome Found".

Q7. Input n integers. Find the number whose digit product is the highest.

Example: 59 → 5×9 = 45, 79 → 7×9 = 63 → Output: 79

Q8. Input n integers. Display numbers where digits alternate between

even and odd. Example: 121, 242

Q9. Input n integers. Display all perfect numbers (equal to sum of proper

divisors). Example: 6 → 1+2+3 = 6

Q10. Input n integers. Find the number with the highest digit sum and

display both the number and the sum.

You might also like