Questions for Practice 1

Basic Java Practice Questions

  • Write a program to print your name in Java.
  • Write a program that finds simple interest. Formula= (p * t * r) / 100
  • Write a program to print an integer entered by the user.
  • Write a program to print String entered by the user.
  • Write a program to multiply two floating-point numbers.
  • Write a program to find the quotient and remainder of two Integers.
  • Write a program to swap two numbers.
  • Write a program to calculate the square of a number.
  • Write a program to remove all whitespaces from the String.
  • Write a program to convert String to int. Hint Integer.parseInt()
  • Write a program to convert double to float.
  • Write a program to ask the user to enter his/her birth year and print the age.