Java Programs
Java Programs
String Programs
1. Write a program to accept a sentence and arrange it with consonants
followed by vowels.
2. Write a program to input a string and encrypt the word by converting
each character to the next character.
3. Write a program to accept a string
Sample Input :Java
Sample Output:
J
Ja
Jav
Java
4. Write a program to input a string.Input a character from the string and
find the frequency of the character in the string and display it.
5. Write a program to input a string terminated by a full stop. Calculate the
frequency of spaces,digits,vowels ,consonants and words in the string.
6. Write a program to input two strings.Find the common words in the two
strings and display it.
Array Programs
1. Write a program to input an array and sort in ascending order using Bubble
sort technique.
2. Write a program to input the size and the elements of a single dimensional
array.Input the number to be inserted and the position of the element to be
inserted .Display the array after insertion.
3. Write a program to input a 4*4 matrix.Calculate the sum of each row and
column and display the result.
4. Write a program to accept a 3*3 matrix.Find the largest number in each row
and display it.
5. Write a program to accept a 4*4 matrix. Calculate the sum of the left and
right diagonals and display the sum
6. Write a program to store 10 numbers in a Single Dimensional array and
check whether a given number is present in the array using Binary Search
technique.