Java Program to Print Name Of Month

In this tutorial you will learn about the Java Program to Print Name Of Month and its application with practical example.

Java Program to Print Name Of Month

In this tutorial, we will learn to create a Java program that will Print Name Of Month using Java programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following Java programming topics:

  • Operators in Java Programming.
  • Basic Input and Output function in Java Programming.
  • Basic Java programming.
  • Conditional Statements in Java programming.
  • Arithmetic operations in Java Programming.

Algorithm:-

Find the Month Name of a year:-

In today’s program, we will take the input month in a range between 1 to 12 from the user. Then we will pass that variable to the conditional statements to find the name of the Month. At last, we will print the resulting name of the Month to the user.

With the help of the below program, we can find the name of the Month in a year.

Program Code:-

Output:-

In the above program, we have first initialized the required variable.

  • mth = it will hold the integer value for the input.

Taking the input month from the user.

Finding the name of the month in a year using conditional statements.

Printing the output of the program.

In this tutorial we have learn about the Java Program to Print Name Of Month and its application with practical example. I hope you will like this tutorial.