Computer Science, asked by msingour7, 7 months ago

फंक्शन विच रिटर्न डे ऑफ़ वीक इस​

Answers

Answered by devanujroy89
0

Answer:

import java.util.Scanner;

public class DAY

{

   public static void main(String []args)  

   {

    int DAY, num;

    System.out.println("Enter below how many days has it been since the start of the week");

    Scanner sc = new Scanner(System.in);

    num = sc.nextInt();

    if (num == 1)

    {

        System.out.println("monday");

    }

    else if (num == 2)

    {

        System.out.println("tuesday");

    }

    else if (num == 3)

    {

        System.out.println("wednesday");

    }

     else if (num == 4)

    {

        System.out.println("thursday");

    }

     else if (num == 5)

    {

        System.out.println("friday");

    }

     else if (num == 6)

    {

        System.out.println("saturday");

    }

     else if (num == 7)

    {

        System.out.println("sunday");

    }

    else  

    {

        System.out.println("ERROR");

    }

   }            

}

Explanation:

Similar questions