Skip to content

thouravi/10-basic-java-exercises

Repository files navigation

10-basic-java-code-exercises

  1. Hello World: Write a program that outputs "Hello, World!" to the console.
  2. Calculate Sum: Write a program that takes two numbers as input and outputs the sum of the numbers.
  3. FizzBuzz: Write a program that outputs numbers from 1 to 100. For multiples of 3, the program should output "Fizz" instead of the number, and for multiples of 5, it should output "Buzz". For numbers that are multiples of both 3 and 5, it should output "FizzBuzz".
  4. Reverse String: Write a program that takes a string as input and outputs the reverse of the string.
  5. Palindrome Checker: Write a program that takes a string as input and outputs whether the string is a palindrome or not.
  6. Factorial Calculator: Write a program that calculates the factorial of a number.
  7. Prime Number Checker: Write a program that takes a number as input and outputs whether the number is prime or not.
  8. Guess the Number Game: Write a program that generates a random number between 1 and 100, and then prompts the user to guess the number. The program should give feedback to the user on whether the guess is too high or too low, until the user correctly guesses the number.
  9. Temperature Converter: Write a program that converts temperature from Celsius to Fahrenheit and vice versa.
  10. Array Sum: Write a program that takes an array of numbers as input and outputs the sum of the numbers in the array.

About

10 Basic Java Exercises

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages