The code is correct and It gives the solution too, but I am not able to satisfy all the conditions. why?
package com.codegym.task.task04.task0413;
/*
Day of the week
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader x = new BufferedReader(new InputStreamReader(System.in));
String N = x.readLine();
String M = x.readLine();
int n = Integer.parseInt(N);
if(n>0&&n<8){
String day[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
System.out.println(day[n]);
}
else
System.out.println("No such day of the week");//write your code here
}
}