Wap to accept the number from 1 to 9 and display the number in name
Answers
Answered by
2
public class numbers
{
public static void main()
{
System.out.println("Menu");
" " "("enter 1 to display in name");
" " "(enter 2 to display in name");
repeat this till nine then...
int ch=sc.nextInt();
switch(ch)
{
case 1:
System.out.println("one");
break;
case 2:
System.out.println("two");
break;
repeat this till nine..n then...
default:
System.out. println("invalid choice");
}}}
{
public static void main()
{
System.out.println("Menu");
" " "("enter 1 to display in name");
" " "(enter 2 to display in name");
repeat this till nine then...
int ch=sc.nextInt();
switch(ch)
{
case 1:
System.out.println("one");
break;
case 2:
System.out.println("two");
break;
repeat this till nine..n then...
default:
System.out. println("invalid choice");
}}}
Similar questions