JAVA-Arijit Jayaswal-KIET Group of Institutions
JAVA-Arijit Jayaswal-KIET Group of Institutions
Basic Java
1. Write a Java program to print 'Hello' on screen and then print your name on a separate line
2. Write a Java program that accepts four integers from the user and prints equal if all four are
equal, and not equal otherwise.
3. Java program to Find Factorial
4. Write a Java program that takes three numbers as input to calculate and print the average of
the numbers
5. Write a Java program to compute a specified formula.
Specified Formula:
4.0 * (1 - (1.0/3) + (1.0/5) - (1.0/7) + (1.0/9) - (1.0/11)
Arrays
1. Write a Java program to print an array after changing the rows and columns of a given two-
dimensional array.
2. Write a Java program to find the k largest elements in a given array. Elements in the array
can be in any order.
3. Write a Java program to find the k smallest elements in a given array. Elements in the array
can be in any order.
4. Write a Java program to sort array in ascending order
Conditional Statement
1. Write a program in Java to display the ‘n’ terms of odd natural number and their sum.
2. Write a program in Java to make such a pattern like a pyramid with a number which will
repeat the number in the same row.
3. Write a program that accepts three numbers from the user and prints "increasing" if the
numbers are in increasing order, "decreasing" if the numbers are in decreasing order, and
"Neither increasing or decreasing order" otherwise.
4. Java program to Display Fibonacci Series
4. Write a Java program that will accept an integer and convert it into a binary representation.
Now count the number of bits which is equal to zero of the said binary representation.
Strings
1. Write a Java program to reverse the content of a sentence (assume a single space between
two words) without reverse every word.
2. Write a Java program to accept two string and test if the second string contains the first one.