Computer Science, asked by maihuterimaa, 1 year ago

anyone of class 10icse ?
give me the coding of imp programs in the link please​

Answers

Answered by 2110
0

switch case program to select days of week

import java.util.*;

class week

{

public static void main (String args[])

{

Scanner sc=new Scanner(System.in);

System.out.println("1.monday");

System.out.println("2.tuesday");

System.out.println("3.wednesday");

System.out.println("4.thursday");

System.out.println("5.friday");

System.out.println("6.saturday");

System.out.println("7.sunday");

System.out.println("pls make ur choice");

int ch=sc.nextInt();

switch (ch)

{

case 1: System.out.println();

          System.out.println();

           break;

case 2: System.out.println();

           break;

           .

           .

           .

case 7: System.out.println();

           break;

default: System.out.println("invalid");

}

}

}

dear friend it is just a sample program in this you may write any content in printing statement

as well as it is important to write break else fall through will be executed

hope it helps if any doubts may follow


maihuterimaa: please follow me so that you could get notifications when I can a question
maihuterimaa: please
2110: ok
2110: i will send a sample program along with switch case syntax in comment line
maihuterimaa: thanks a lot
2110: just to confirm r u using scanner class
maihuterimaa: yes
maihuterimaa: see my questions of comp sci
maihuterimaa: n answer
maihuterimaa: please
Similar questions