Saturday, August 6, 2011

ENTER THE DAY NUMDBER AND GET THE DAY OF WEEK

import java.util.*;
class day
{
public static void main(String args[])
{

Scanner s=new Scanner(System.in);
System.out.println("enter the day number:");
String s1=s.next();
char c=s1.charAt(0);
System.out.println("the day is:"+c);
switch(c)
{


case '1':
System.out.println("monday");
break;

case '2':
System.out.println("tuesday");
break;

case '3':
System.out.println("wednesday");
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("others");
break;


}



}
}

OUT PUT:
enter the day number:6
the day is:saturday
If U LIKE THE POST FOLLOW THE BLOG

No comments:

Post a Comment