Java Practice

BASIC PROGRAMS

  1. Program to check whether the given number is positive, negative or zero.
  2. Program to find largest number between two numbers.
  3. Program to find largest number between three numbers.
  4. Program to find second largest number between three numbers.
  5. Program to print wishes according to the time given in hours.
  6. Program to check whether given alphapet is vowel or consonant.
  7. Program to check whether given character is alphabet, digit or symbol.
  8. Write a program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer. Calculate percentage and grade according to following:
    Percentage >= 90% : Grade A
    Percentage >= 80% : Grade B
    Percentage >= 70% : Grade C
    Percentage >= 60% : Grade D
    Percentage >= 40% : Grade E
    Percentage < 40% : Grade F
  9. Program to read a single digit number and print in words.
  10. Program to display number of days in a given month.
  11. Program to print natural numbers from 1 to N.
  12. Program to print natural numbers from N to 1.
  13. Program to find sum of N natural numbers.
  14. Program to display multiplication table of a given number.
  15. Program to count number of digits of a given number.
  16. Program to find sum of digits of a given number.
  17. Program to find reverse of a given number.
  18. Program to check whether given number is palindrome or not.
  19. Program to find factorial of given number.
  20. Program to check whether a number is prime or not.

PROGRAMS ON ARRAYS

  1. Program to find sum of array elements.
  2. Program that calculate the fractions of its elements that are positive, negative and zeros.
  3. Program to insert an element at given position in array.
  4. Program to delete an element from an array at specified position.
  5. Program to reverse of array elements.
  6. Program to remove duplicates in array.
  7. Program to move first element to last in array.
  8. Program to count the frequency of each element of an array.
  9. Program to sort the elements in array.
  10. Program to find second smallest and second largest numbers from array.
  11. Program for left rotate of array.
  12. Program for right rotate of array.
  13. Program to find duplicate element in k-distance. If found print "YES" otherwise "NO".