250+ java Programs for Practice

1. Simple C Questions

  1. Area and Circumference of a Circle
  2. Print Ascii Value of the Character
  3. Area of Triangle
  4. Convert a Person’s Name in Abbreviated
  5. Simple Interest
  6. Gross Salary of an Employee
  7. Percentage of 5 Subjects
  8. Converting Temperature Celsius into Fahrenheit
  9. The Display Size of the Different Data Type
  10. Factorial of a Given Number
  11. Read Integer (N) and Print the First Three Powers (N^1, N^2, N^3)
  12. Area of a Circle
  13. LCM of Two Numbers
  14. GCD of Two Numbers

2. If/Else Statement

  1. The Greatest Number Among the Given Three Number
  2. The Number Is Positive or Negative
  3. Character Is Vowel or Consonant
  4. A Character Is an Alphabet or Not
  5. Uppercase, Lowercase, Special Character, or Digit
  6. The Number Is Positive or Negative
  7. The Number Is Even or Odd
  8. Greatest of Two Numbers
  9. Greatest Among Three Numbers
  10. Leap Year
  11. The Date Is Correct or Not
  12. Voting Eligibility Checker
  13. Find the maximum between two numbers.
  14. Find the maximum between the three numbers.
  15. Check whether a number is negative, positive or zero.
  16. Check whether a number is divisible by 5 and 11 or not.
  17. Find whether a number is even or odd.
  18. Check whether a year is a leap year or not.
  19. Check whether a character is an alphabet or not.
  20. Input any alphabet and check whether it is vowel or consonant.
  21. Input any character and check whether it is the alphabet, digit or special character.
  22. Check whether a character is an uppercase or lowercase alphabet.
  23. Input week number and print weekday.
  24. Input month number and print number of days in that month.
  25. Count the total number of notes in a given amount.
  26. Input angles of a triangle and check whether the triangle is valid or not.
  27. Input all sides of a triangle and check whether the triangle is valid or not.
  28. Check whether the triangle is an equilateral, isosceles or scalene triangle.
  29. Find all roots of a quadratic equation.
  30. Calculate profit or loss.

Loops

1. While Loop or While-Do Loop Questions

  1. Reverse A given Number
  2. Find Number Is Armstrong Or Not
  3. Calculate Sum of Natural Numbers
  4. Display Fibonacci Series
  5. Find LCM of two Numbers
  6. Reverse a Number
  7. Check Whether a Number is A Palindrome or Not
  8. Count Number of Digits of an Integer
  9. Find A Generic Root Of Number
  10. Print A Calendar Taking Input From User Using Loop
  11. Number Is Divisible By 11 Using (VEDIC MATH)
  12. Denomination of an Amount

Do-While Loop Questions Solve the above program using Do-While Loop

For Loop Questions

  1. Generate IP (Internet Protocol) Addresses Using
  2. Print Multiplication Table Using
  3. Sort A Float Array In Ascending And Descending Order Using
  4. Find GCD of two Numbers Using

Switch Case

  1. Temperature Conversion Celsius To Fahrenheit And Vice Versa
  2. Find The Day
  3. Calculator
  4. Find A Grade Of Given Marks or (Find a Grade of Given Marks Using Switch Case)
  5. Find Radius, Circumference and Volume of Cylinder
  6. Remove All Vowels From A String
  7. Print day of week name using switch case.
  8. Print total number of days in a month using switch case.
  9. Check whether an alphabet is a vowel or consonant using a switch case.
  10. Find the maximum between two numbers using the switch case.
  11. Check whether a number is even or odd using a switch case.
  12. Check whether a number is positive, negative or zero using a switch case.
  13. Find roots of a quadratic equation using switch case.
  14. Create a Simple Calculator using a switch case.

3. Array Questions

  1. Insert An Element Desired or Specific Position In An Array
  2. Remove Duplicates Items In An Array
  3. Delete Element From Array At Desired Or Specific Position
  4. Print “I AM IDIOT” Instead Of Your Name Using Array
  5. Check String Is Palindrome Or Not Using For Loop
  6. Convert All Input String Simultaneously Into Asterisk ( * )
  7. Read and print elements of the array. – using recursion.
  8. Print all negative elements in an array.
  9. Sum of all array elements. – using recursion.
  10. Find a maximum and minimum element in an array. – using recursion.
  11. Get the second largest element in an array.
  12. Count the total number of even and odd elements in an array.
  13. Count the total number of negative elements in an array.
  14. Copy all elements from an array to another array.
  15. Insert an element in an array.
  16. Delete an element from an array at the specified position.
  17. Count frequency of each element in an array.
  18. Print all unique elements in the array.
  19. Count the total number of duplicate elements in an array.
  20. Delete all duplicate elements from an array.
  21. Merge two arrays to the third array.
  22. Find the reverse of an array.
  23. Put even and odd elements of an array in two separate arrays.
  24. Search an element in an array.
  25. Sort array elements in ascending or descending order.
  26. Sort even and odd elements of the array separately.
  27. Left rotate an array.
  28. Right rotate an array.

4. String Questions List

  1. String Char-Case Change
  2. A String is Palindrome or Not
  3. A String Is an Anagram or Not
  4. Find the length of a string.
  5. Copy one string to another string.
  6. Concatenate two strings.
  7. Compare two strings.
  8. Convert lowercase string to uppercase.
  9. Convert uppercase string to lowercase.
  10. Toggle case of each character of a string.
  11. Find a total number of alphabets, digits or special character in a string.
  12. Count the total number of vowels and consonants in a string.
  13. Count the total number of words in a string.
  14. Find the reverse of a string.
  15. Check whether a string is a palindrome or not.
  16. Reverse order of words in a given string.

5. String Questions: Level Up

  1. Find the first occurrence of a character in a given string.
  2. Find the last occurrence of a character in a given string.
  3. Search all occurrences of a character in a given string.
  4. Count occurrences of a character in a given string.
  5. Find the highest frequency character in a string.
  6. Find the lowest frequency character in a string.
  7. Count the frequency of each character in a string.
  8. Remove the first occurrence of a character from a string.
  9. Remove the last occurrence of a character from a string.
  10. Delete all occurrences of a character from a string.
  11. Remove all repeated characters from a given string.
  12. Replace the first occurrence of a character with another in a string.
  13. Replace the last occurrence of a character with another in a string.
  14. Put all occurrences of a character with another in a string.
  15. Find the first occurrence of a word in a given string.
  16. Find the last occurrence of a word in a given string.
  17. Search all occurrences of a word in a given string.
  18. Count occurrences of a word in a given string.
  19. Remove the first occurrence of a word from the string.
  20. Remove the last occurrence of a word in a given string.
  21. Delete all occurrence of a word in a given string.
  22. A Trim leading white space characters from a given string.
  23. Trim trailing white space characters from a given string.
  24. Trim both leading and trailing white space characters from a given string.
  25. Remove all extra blank spaces from the given string.

Leave a Comment