Basic Programming Questions
- Write a Java Program to find the biggest number among two numbers (Using if Statement).
- Find the biggest Number among three numbers (Using if Statement).
- Check the given number is even or odd without using modulo Operator.
- Check the given year is leap year or not.
- Write a Java program to print “Saju” if the given number is divisible by 3, “Geta” if divisible by 5, or “Saju Geta” if divisible by both 3 and 5, otherwise print “Breakup”.
- Write a Java program to find the smallest number among three numbers (Using if-else ladder).
- Write a Java program to find the biggest number among two numbers using the ternary operator.
- Write a Java program to find the smallest number among three numbers using the ternary operator.
- A customer has a bank account with a balance of 10000. Write a program to withdraw an amount from the account. The withdrawal should be successful if the balance is sufficient; otherwise, it should fail. If successful, show the remaining balance.
- Write a Java program to print all the even numbers present between 1 to 20.
- Write a Java program to print the factorial of a given number.
- Write a Java program to check if a user-entered number is a perfect number or not.
- Write a Java program to count how many digits are 0 in a user-entered number.
- Write a Java program to print the sum of each digit in a user-entered number.
- Write a Java program to print the product of each digit in a user-entered number.
- Write a Java program to check if a given number is a palindrome or not.
- Write a Java program to check if a given number is a Neon number or not.
- Write a Java program to find npnp (power of a number).
- Write a Java program to check if a given number is prime or not.
- Write a Java program to print all the prime numbers between 1 to 100.
- Write a Java program to print the sum of all prime numbers between 1 to 15.
- Write a Java program to print even/odd using a method with a boolean return type.
- Write a Java program to check if a given number is prime using a method with a boolean return type.
- Write a Java program to check if a given number is an Armstrong number.
- Write a Java program to print the first N prime numbers.
- Write a Java program to print the nearest prime number to a given number.
- Write a Java program to convert a decimal value into binary.
- Write a Java program to convert a decimal value into octal.
- Write a Java program to convert a decimal value into hexadecimal.
- Write a Java program to swap two numbers without using a temporary variable.
- Write a Java program to print the Fibonacci series.
- Write a Java program to find the factorial of a given number using recursion.
- Write a Java program to count how many digits are present in a given number using recursion.
Array Questions
- Write a Java program to print even index elements in an array.
- Write a Java program to print the sum of odd elements in an array.
- Write a Java program to print all the prime numbers present in an array.
- Write a Java program to take array input from the user and print the array elements.
- Write a Java program to replace every element in an array by the sum of its digits.
- Write a Java program to find the biggest element in an array.
- Write a Java program to find the smallest element in an array.
- Write a Java program to check if the sum of the smallest and biggest elements in an array is a prime number.
- Write a Java program to perform a linear search in an array.
- Write a Java program to sort array elements in ascending order.
- Write a Java program to sort array elements in descending order.
- Write a Java program to merge two arrays into a single array.
- Write a Java program to print the occurrence or frequency of each element in an array.
- Write a Java program to print unique elements in an array.
- Write a Java program to print duplicate elements in an array.
- Write a Java program to insert an element at a specified index in an array.
- Write a Java program to delete an element from a specified index in an array.
- Write a Java program to check if array elements are in ascending order.
- Write a Java program to print missing elements in an array.
- Write a Java program to find the second smallest element in an array.
- Write a Java program to print how many String elements are present in an Object array.
- Write a Java program to print double-type elements present in an Object array.
String Questions
- Write a Java program to reverse a given String.
- Write a Java program to count how many alphabets, digits, and special characters are present in a given String.
- Write a Java program to print the sum of digits in a String.
- Write a Java program to count how many vowels and consonants are present in a given String.
- Write a Java program to convert uppercase characters to lowercase and vice versa in a String.
- Write a Java program to count the number of words in a String.
- Write a Java program to convert the first character of each word to uppercase and the remaining characters to lowercase.
- Write a Java program to swap the first and last characters of each word in a String.
- Write a Java program to sort the characters in a String in ascending order.
- Write a Java program to find the occurrence or frequency of each character in a String.
- Write a Java program to print duplicate characters in a String.
- Write a Java program to print unique characters in a String.
- Write a Java program to check if two Strings are anagrams.
- Write a Java program to check if a String is a pangram.
- Write a Java program to reverse each word in a String.
- Write a Java program to reverse the sentence in a String.
- Write a Java program to check if a String is a palindrome.
- Write a Java program to check if a String is unique (all characters are distinct).
- Write a Java program to find the longest unique substring in a String.
2D Array Questions
- Write a Java program to print prime elements in a 2D array.
- Write a Java program to print the sum of diagonal elements in a 2D array.
Loop Questions
- Write a Java program to print all even numbers between 1 to 20 using a do-while loop.
- Write a Java program to iterate over an array using a for-each loop.
Bitwise and Shift Operators Questions
- Explain the use of bitwise AND, OR, and XOR operators with examples.
- Explain the use of left shift and right shift operators with examples.
Miscellaneous Questions
- CONVERT SECONDS INTO HOURS AND MINUTES
- CHECK THE NUMBER CONTAINS ANY ODD DIGIT OR NOT
- CHECK THE NUMBER IS UNIQUE OR NOT
- PRINT N FIBBONACCI NUMBERS
- WAP TO PRINT THE SUM OF ODD DIGITS PRESENT IN THE NUMBER
- WAP TO PRINT THE SUM OF PRIME DIGITS PRESENT IN THE NUMBER
- WAP TO SWAP TWO NUMBERS WITHOUT USING TEMP VARIABLE
- WAP TO FIND GCD FOR THE GIVEN TWO NUMBERS