package com.company;
import java.util.Scanner;
public class Program19 {
public static void main(String[] args) {
Scanner put = new Scanner(System.in);
System.out.println("please enter a number for check a day name: ");
int day=put.nextInt();
switch(day)
{
case 1:
System.out.println("monday");
break;
case 2:
System.out.println("tuesday");
break;
case 3:
System.out.println("wednessday");
break;
case 4:
System.out.println("thursday");
break;
case 5:
System.out.println("friday");
break;
case 6:
System.out.println("saturday");
break;
case 7:
System.out.println("sunday");
break;
default:
System.out.println("wrong input");
break;
}
}
}
Hi Friends ! You are on HR Developers website. Here you can find the codes of different languages like c ,c++ , java, pyton and many other languages.
Wednesday, June 16, 2021
Java program that keeps a number from the user between 1 and 7 and displays the name of the weekday (Java) (182)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment