University has restricting those students having odd roll numbers in the campus on Monday, Wednesday, and friday and for those students having even roll number on Tuesday, Thursday and saturday. Demonstrate the scenario by completing the following code snippet that will inform to the students on which day he/she can come to the campus
public class Main {
public void check(int rollNumber) {
if (rollNumber % 2 != 0) {
System.out.println("Monday, Wednesday, and Friday");
} else {
System.out.println("Tuesday, Thursday and Saturday");
}
}
}
Comments
Leave a comment