import java.util.*;
public class SwitchEx{
public static void main(String[]args)
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter your lack number 1 To 10 between ");
int number =sc.nextInt();
switch(number){
//case statement
case 1: System.out.println();
break;
case 2: System.out.println(" MY Love is Your Love");
break;
case 3: System.out.println("I need you");
break;
case 4: System.out.println("Baby Can I hold you");
break;
case 5: System.out.println("Kiss from a rose");
break;
case 6: System.out.println("Next To Me ");
break;
case 7: System.out.println("I like YOu you are so good");
break;
case 8: System.out.println(" I can manage within you" );
break;
case 9: System.out.println(" nothing special");
break;
case 10: System.out.println("will you marry me");
break;
default: System.out.println("Invaild your lacky num....reagain input");
}
}
}
that is result:
c:/shashi/javac SwitchEx.java
c:/shashi/java SwitchEx
Enter you lacky no 5
Kiss from a rose
public class SwitchEx{
public static void main(String[]args)
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter your lack number 1 To 10 between ");
int number =sc.nextInt();
switch(number){
//case statement
case 1: System.out.println();
break;
case 2: System.out.println(" MY Love is Your Love");
break;
case 3: System.out.println("I need you");
break;
case 4: System.out.println("Baby Can I hold you");
break;
case 5: System.out.println("Kiss from a rose");
break;
case 6: System.out.println("Next To Me ");
break;
case 7: System.out.println("I like YOu you are so good");
break;
case 8: System.out.println(" I can manage within you" );
break;
case 9: System.out.println(" nothing special");
break;
case 10: System.out.println("will you marry me");
break;
default: System.out.println("Invaild your lacky num....reagain input");
}
}
}
that is result:
c:/shashi/javac SwitchEx.java
c:/shashi/java SwitchEx
Enter you lacky no 5
Kiss from a rose
0 comments:
Post a Comment