0% found this document useful (0 votes)
3 views

Java Beginner Questions 1

The document contains a list of beginner-friendly Java programming questions and tasks designed to help learners practice fundamental concepts. It covers a wide range of topics including conditionals, loops, arrays, string manipulation, and basic algorithms. Each task is aimed at enhancing coding skills through practical implementation.

Uploaded by

lavanyasingh0908
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Java Beginner Questions 1

The document contains a list of beginner-friendly Java programming questions and tasks designed to help learners practice fundamental concepts. It covers a wide range of topics including conditionals, loops, arrays, string manipulation, and basic algorithms. Each task is aimed at enhancing coding skills through practical implementation.

Uploaded by

lavanyasingh0908
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Beginner-Friendly Java Questions

1. Write a Java program to check if a number is positive, negative, or zero.

2. Write a Java program to find the largest of three numbers using if-else.

3. Write a Java program to check if a number is even or odd.

4. Write a Java program to check whether a given year is a leap year or not.

5. Write a Java program that takes a character as input and checks if it is a vowel or consonant.

6. Write a Java program to calculate electricity bill based on usage.

7. Write a Java program to simulate a simple ATM using if-else conditions.

8. Write a Java program to create a simple calculator using switch-case.

9. Write a Java program to display the day of the week based on a number (1-7) using switch-case.

10. Write a Java program that asks for a month number and displays the corresponding month
name.

11. Write a Java program to print numbers from 1 to 10 using a for loop.

12. Write a Java program to print even numbers between 1 and 20 using a while loop.

13. Write a Java program to calculate the sum of digits of a number using a while loop.

14. Write a Java program to display multiplication tables for numbers 1 to 5.

15. Write a Java program to print the first 10 Fibonacci numbers using a loop.

16. Write a Java program to print numbers from 1 to 10 but stop at 6 using break.

17. Write a Java program to print numbers from 1 to 10 but skip 5 using continue.

18. Write a Java program to find the factorial of a number using recursion.

19. Write a Java program to find the sum of an array using a function.

20. Write a Java function to check if a number is prime.

21. Write a Java function to find the greatest common divisor (GCD) of two numbers.

22. Write a Java program to reverse a string.

23. Write a Java program to count the number of vowels in a string.

24. Write a Java program to check if a given string is a palindrome.


25. Write a Java program to replace spaces in a string with dashes.

26. Write a Java program to find the frequency of characters in a string.

27. Write a Java program to find the maximum and minimum element in an array.

28. Write a Java program to find the sum and average of elements in an array.

29. Write a Java program to search for an element in an array.

30. Write a Java program to reverse an array.

31. Write a Java program to add two matrices.

32. Write a Java program to subtract two matrices.

33. Write a Java program to multiply two matrices.

34. Write a Java program to find the transpose of a matrix.

35. Write a Java program to find the sum of each row and each column in a matrix.

36. Write a Java program to find the LCM of two numbers.

37. Write a Java program to convert a decimal number to binary.

38. Write a Java program to check if a number is a perfect number.

39. Write a Java program to generate and print the first 10 prime numbers.

40. Write a Java program to print Pascal's Triangle.

41. Write a Java program to find the sum of first N natural numbers.

42. Write a Java program to implement a simple number guessing game.

43. Write a Java program to check if an array is sorted in ascending order.

44. Write a Java program to rotate an array to the right by one position.

45. Write a Java program to merge two sorted arrays.

46. Write a Java program to count the occurrence of a specific element in an array.

47. Write a Java program to find the largest word in a given sentence.

48. Write a Java program to sort an array using the Bubble Sort algorithm.

49. Write a Java program to check if two strings are anagrams.

50. Write a Java program to implement basic stack operations using an array.

You might also like