P2Cart Logo
Store the numbers in 4 by 4 Matrix in Double Dimensional Array.

This Java program demonstrates how to store numbers in a 4x4 matrix using a two-dimensional array, find the highest and lowest numbers, and display the results. Meta tags are included for SEO purposes.

Read more
Write a program in Java to store the numbers in 4 by 4 Matrix in Double Dimensional Array. Find the highest and the lowest number of the Matrix by using assignment statement.
Read Answer
Store the numbers in 3 by 4 Matrix in Double Dimensional Array

This Java program demonstrates how to store numbers in a 3x4 matrix using a two-dimensional array, calculate the sum of all its elements, and display the sum. Meta tags are provided for SEO purposes.

Read more
Write a program in Java to store the numbers in a 3 by 4 Matrix in Double Dimensional Array. Find the sum of all the numbers of the Matrix and display the sum using assignment statement.
Read Answer
The Pascal’s triangle.

Here’s a Java program that generates Pascal’s Triangle up to a specified number of rows using a single-dimensional array (S.D.A.). Additionally, I’ve included all meta tags in HTML format as per your request.

Read more
Write a program in Java to display Pascal’s Triangle using Single Dimensional Array. The Pascal’s triangle.
1
1  1
1  2  1
1  3  3  1
1  4  6  4  1

Read Answer
Accept 10 names in an S.D.A and display all those names whose first alphabet matches the alphabet given by the user.

Here’s a Java program that accepts 10 names in a single-dimensional array (S.D.A.) and displays all names that start with an alphabet specified by the user. Additionally, the HTML meta tags are provided as per your request.

Read more
Write a program in Java to accept 10 names in an S.D.A and display all those names whose first alphabet matches the alphabet given by the user.
Sample Input: Amit
                         Sumit
                         Aman
                         Dilip and so on….
Sample Output: Enter your alphabet
                             A
                             Amit
                             Aman ……

Read Answer
Accept 10 States and 10 Capitals of a country in two different S.D.A.

Here’s a Java program that accepts 10 states and their corresponding capitals into two different Single Dimensional Arrays (S.D.A). The program then prompts the user to enter a state name and searches for its capital. If the state is found, it displays the capital; if not, it displays a relevant message. The program uses InputStream for accepting input, and meta tags are generated as requested.

Read more
Write a program in Java to accept 10 States and 10 Capitals of a country in two different S.D.A. Now enter the State of a country to display the capital and if it is not present then display the relevant message.
[Hint: Use of Input Stream]
Sample Input: Enter the State and Capital
                         Jharkhand
                         Ranchi
                         Bihar
                         Patna 
                         West Bengal
                         Kolkata and so on……
Sample Output: Enter the State whose Capital is to be searched
                             Jharkhand
                             The capital is Ranchi

Read Answer
Accept a String (Containing three words) in an S.D.A and display the String in reversed order.

Here's a Java program that accepts a string containing three words, stores them in a Single Dimensional Array (S.D.A.), and displays the string in reversed order. The program uses InputStream to accept input from the user.

Read more
Write a program in Java to accept a String (Containing three words) in an S.D.A and display the String in reversed order.
[Hint: Use of Input Steam]
Sample Input: Computer is Fun
Sample Output: Fun is Computer

Read Answer
Arrange all the alphabets of the word in ascending order and display the new word.

This Java program accepts a word from the user, sorts the letters in ascending order, and displays the newly sorted word.

Read more
Write a program in Java to accept a word. Arrange all the alphabets of the word in ascending order and display the new word.
[Hint: Use of Input Stream]
Sample Input: BLUEJ
Sample Output: BEJLU

Read Answer
Sort the numbers in ascending order by using Bubble Sort technique.

Here is the Java program that accepts a set of 10 integers, sorts them in ascending order using the Bubble Sort technique, and displays the sorted array. Additionally, the meta tags are included in HTML format as per your request.

Read more
Write a program in Java to enter a set of 10 integers. Sort the numbers in ascending order by using the Bubble Sort technique. Display the sorted array.
Read Answer
Accepts 10 different city names in a Single Dimensional Array (S.D.A).

This program accepts 10 different city names, sorts them in ascending order using the Bubble Sort algorithm, and displays the sorted list. It uses InputStream to read user input. The Bubble Sort algorithm repeatedly swaps adjacent elements if they are in the wrong order, until the array is sorted.

Read more
When a program in Java accepts 10 different city names in a Single Dimensional Array (S.D.A). Arrange the names in ascending order using the Bubble Sort method and display them.
[Hint: Use of Input Stream]
Sample Input: Delhi, Bangalore, Agra, Mumbai, Calcutta
Sample Output: Agra, Bangalore, Calcutta, Delhi, Mumbai

Read Answer
Arrange the numbers in ascending order using the Selection Sort method and display them.

Here’s a Java program that accepts 10 different numbers in a Single Dimensional Array (S.D.A.), arranges them in ascending order using the Selection Sort method, and then displays the sorted numbers. The program uses an InputStream for accepting the input:

Read more
Write a program in Java to accept 10 different numbers in a Single Dimensional Array (S.D.A). Arrange the numbers in ascending order using the Selection Sort method and display them.
[Hint: Use of Input Stream]

Read Answer
Accept 10 different numbers in a Single Dimensional Array (S.D.A).

This Java program accepts 10 different numbers in a Single Dimensional Array (S.D.A.), sorts the array, and then uses the Binary Search technique to check if a given number is present in the array. If found, it displays "Search Successful," otherwise "The Search Unsuccessful."

Read more

Write a program in Java to accept 10 different numbers in a Single Dimensional Array (S.D.A). Enter a number and using Binary Search technique, check whether the number is present or not in the array. If the number is present then display the message “Search Successful” otherwise “The Search Unsuccessful”. 

Read Answer
Accept 10 different numbers in a Single Dimensional Array (S.D.A) search whether a given number is present or not and display the relevant message.

This Java program accepts 10 different numbers into an array and searches for a given number, displaying whether it's present or not using an input stream and BufferedReader for reading input.

Read more
Write a program in Java to accept 10 different numbers in a Single Dimensional Array (S.D.A) search whether a given number is present or not and display the relevant message.
[Hint: Use of input Stream]
Read Answer
Accept 10 different numbers in a Single Dimensional Array (S.D.A) and display the maximum and the minimum number of the array elements.

This program prompts the user to input 10 different numbers, stores them in a single-dimensional array, and then finds and displays both the maximum and minimum values from the array.

Read more

Write a program in Java to accept 10 different numbers in a Single Dimensional Array (S.D.A) and display the maximum and the minimum number of the array elements.

[Hint: Use of input Stream]
Read Answer
Assign 10 different numbers in a Single Dimensional Array (S.D.A.) and display the greatest number of the elements.

This Java program demonstrates how to assign 10 different numbers in a Single Dimensional Array (S.D.A.) and find the greatest number by iterating through the array.

Read more

Write a program in Java to assign 10 different numbers in a Single Dimensional Array (S.D.A.) and display the greatest number of the elements.

Read Answer
Write a program to generate a pattern of a string entered by the user based on the User’s choice.

This Java program accepts a string from the user and generates a pattern based on the user's choice—either from the start of the string or from the end.

Read more
Write a program to generate a pattern of a string entered by the user based on the User’s choice.
Sample Input: HONESTY IS THE BEST POLICY

Enter your choice: 1

Sample Output: H

   I

  T

  B

  P

Enter your choice: 2

Sample Output: Y

   S

   E

   T

  Y

Read Answer
Write a program to generate a triangle or an inverted triangle based upon User’s choice.

This Java program generates a triangle or inverted triangle based on user input, displaying patterns using the letters of a given word.

Read more

Write a program to generate a triangle or an inverted triangle based on User’s choice.

Example 1:

Input: Type 1 for a triangle and Type 2 for an inverted triangle

Enter your choice 1

Enter a word: BLUEJ

Sample Output:

B

B L

B L U

B L U E

B L U E J

Example 2

Input: Type 1 for a triangle and Type 2 for an inverted triangle of alphabets

Enter your choice 2

Enter a word: BLUEJ

Sample Output:

B L U E J

B L U E

B L U

B L

B

Read Answer
Write a program to generate a triangle or an inverted triangle till n terms based upon the User’s choice of triangle to be displayed.

This Java program enables users to generate a triangle or an inverted triangle pattern based on their input, displaying either stars or alphabetic characters.

Read more
Write a program to generate a triangle or an inverted triangle till n terms based upon the User’s choice of triangle to be displayed.

Example 1:

Input: Type 1 for a triangle and Type 2 for an inverted triangle

Enter your choice 1

Entre the number of terms 5

Sample Output:

*

**

***

****

*****

Example 2

Input: Type 1 for a triangle and Type 2 for an inverted triangle of alphabets

Enter your choice 2

Entre the number of terms 5

Sample Output:

A B C D E

A B C D

A B C

A B

A

Read Answer
Write a program to display the pattern:

This program is flexible and can be adapted to other words for similar patterns, showing a creative approach to sequence-based pattern generation.

Read more
Write a program to display the pattern:            
   a)  ABCDE            b)  A                        c)  B L U E J
         B C D E                 B C                          B L U E B
         C D E                    D E F                       B L U B L
           D E                       G H I J                     B L B L U

             E                           K L M N O              B B L U E
Read Answer
Write a program to accept a word (Say, BLUEJ) and display the pattern:

This program accepts a word and displays three distinct patterns: removing characters from the end, repeating each character based on position, and removing characters from the beginning.

Read more

Write a program to accept a word (Say, BLUEJ) and display the pattern:

     a)  BLUEJ               b)  J                        c)  BLUEJ

            BLUE                      EE                          LUEJ

            BLU                        UUU                      UEJ

            BL                           LLLL                      EJ

            B                             BBBBB                   J

Read Answer
Write a program to input a String. Count and display the frequency of each alphabet in an order, which is present in the String.

Here's a Java program that accepts a string, counts the frequency of each alphabet in the order of their first appearance, and displays the results in a formatted table.

Read more
Write a program to input a String. Count and display the frequency of each alphabet in an order, which is present in the String.
Sample Input: COMPUTER APPLICATIONS
Sample Output:   

Character

Frequency

Character

Frequency

A

2

O

2

C

2

P

3

I

1

R

1

L

2

S

1

M

1

T

2

N

1

U

1

Read Answer